/usr/local/lib64/python3.6/site-packages/torch/fx/__pycache__
Edit: /usr/local/lib64/python3.6/site-packages/torch/fx/__pycache__/proxy.cpython-36.pyc (14427B)
3
Eg9 @ sp d dl Z d dlZd dlZd dlZd dlZddlmZmZmZ d dl m
Z
mZmZm
Z
mZmZmZ ddlmZmZmZmZmZ ddlmZ ddlmZ edd G d
d dZedd G dd
d
eZedd G dd deZedd G dd dZedd G dd deZ edd G dd deZ!xeD ]Z"dd Z#e#e" q2W dd Z$xeD ]Z%e$e% qZW dS ) N )
magic_methodsreflectable_magic_methodsGraph)TupleDictOptionalIterableAnyIteratorCallable)TargetNodeArgument
base_types
map_aggregate)
compatibility)check_for_mutable_operationT)is_backward_compatiblec @ s2 e Zd ZU edZedZeeddde e
eedf e
e ef ee ee edddZedded d
ddZeddde e
eedf e
e ef ee ee eegd f d
ddZdd ZeddeedddZeddd edddZeddd edddZeddd edddZdS )
TracerBaseFT)r N.)kindtargetargskwargsname type_exprreturnc C s0 |dkr| j rt||| | jj||||||S )a'
Inserts a graph node given target, args, kwargs, and name.
This method can be overridden to do extra checking, validation, or
modification of values used in node creation. For example, one might
want to disallow in-place operations from being recorded.
call_function)check_mutable_operationsr graphcreate_node)selfr r r r r r r" :/usr/local/lib64/python3.6/site-packages/torch/fx/proxy.pyr s zTracerBase.create_nodeProxy)noder c C s
t || S )N)r$ )r! r% r" r" r# proxy% s zTracerBase.proxy)r r r r r r proxy_factory_fnc C s | j |}| j |} t|ts"tt| ts0t| j|||| ||}
|sT| j|
}n||
}| jr| j }|rt j
|}
t jj|
}|j
}dj||j_|S )ao
Create a Node from the given arguments, then return the Node
wrapped in a Proxy object.
If kind = 'placeholder', then we're creating a Node that
represents the parameter of a function. If we need to encode
a default parameter, we use the ``args`` tuple. ``args`` is
otherwise empty for ``placeholder`` Nodes.
)
create_arg
isinstancetupleAssertionErrordictr r&