PropagateUnbackedSymInts#
- class torch.fx.experimental.symbolic_shapes.PropagateUnbackedSymInts(module, garbage_collect_values=True, graph=None)[source]#
- boxed_run(args_list)[source]#
- Run module via interpretation and return the result. This uses the “boxed” calling convention, where you pass a list of arguments, which will be cleared by the interpreter. This ensures that input tensors are promptly deallocated. - Note - Backwards-compatibility for this API is guaranteed. 
 - call_function(target, args, kwargs)[source]#
- Execute a - call_functionnode and return the result.- Parameters
- target (Target) – The call target for this node. See Node for details on semantics 
- args (Tuple) – Tuple of positional args for this invocation 
- kwargs (Dict) – Dict of keyword arguments for this invocation 
 
- Return type
 - Return
- Any: The value returned by the function invocation 
 - Note - Backwards-compatibility for this API is guaranteed. 
 - call_method(target, args, kwargs)[source]#
- Execute a - call_methodnode and return the result.- Parameters
- target (Target) – The call target for this node. See Node for details on semantics 
- args (Tuple) – Tuple of positional args for this invocation 
- kwargs (Dict) – Dict of keyword arguments for this invocation 
 
- Return type
 - Return
- Any: The value returned by the method invocation 
 - Note - Backwards-compatibility for this API is guaranteed. 
 - call_module(target, args, kwargs)[source]#
- Execute a - call_modulenode and return the result.- Parameters
- target (Target) – The call target for this node. See Node for details on semantics 
- args (Tuple) – Tuple of positional args for this invocation 
- kwargs (Dict) – Dict of keyword arguments for this invocation 
 
- Return type
 - Return
- Any: The value returned by the module invocation 
 - Note - Backwards-compatibility for this API is guaranteed. 
 - fetch_args_kwargs_from_env(n)[source]#
- Fetch the concrete values of - argsand- kwargsof node- nfrom the current execution environment.- Parameters
- n (Node) – The node for which - argsand- kwargsshould be fetched.
- Returns
- argsand- kwargswith concrete values for- n.
- Return type
- Tuple[Tuple, Dict] 
 - Note - Backwards-compatibility for this API is guaranteed. 
 - fetch_attr(target)[source]#
- Fetch an attribute from the - Modulehierarchy of- self.module.- Parameters
- target (str) – The fully-qualified name of the attribute to fetch 
- Returns
- The value of the attribute. 
- Return type
- Any 
 - Note - Backwards-compatibility for this API is guaranteed. 
 - get_attr(target, args, kwargs)[source]#
- Execute a - get_attrnode. Will retrieve an attribute value from the- Modulehierarchy of- self.module.- Parameters
- target (Target) – The call target for this node. See Node for details on semantics 
- args (Tuple) – Tuple of positional args for this invocation 
- kwargs (Dict) – Dict of keyword arguments for this invocation 
 
- Returns
- The value of the attribute that was retrieved 
- Return type
- Any 
 - Note - Backwards-compatibility for this API is guaranteed. 
 - map_nodes_to_values(args, n)[source]#
- Recursively descend through - argsand look up the concrete value for each- Nodein the current execution environment.- Parameters
- args (Argument) – Data structure within which to look up concrete values 
- n (Node) – Node to which - argsbelongs. This is only used for error reporting.
 
- Return type
- Optional[Union[tuple[‘Argument’, …], Sequence[Argument], Mapping[str, Argument], slice, range, Node, str, int, float, bool, complex, dtype, Tensor, device, memory_format, layout, OpOverload, SymInt, SymBool, SymFloat]] 
 - Note - Backwards-compatibility for this API is guaranteed. 
 - output(target, args, kwargs)[source]#
- Execute an - outputnode. This really just retrieves the value referenced by the- outputnode and returns it.- Parameters
- target (Target) – The call target for this node. See Node for details on semantics 
- args (Tuple) – Tuple of positional args for this invocation 
- kwargs (Dict) – Dict of keyword arguments for this invocation 
 
- Returns
- The return value referenced by the output node 
- Return type
- Any 
 - Note - Backwards-compatibility for this API is guaranteed. 
 - placeholder(target, args, kwargs)[source]#
- Execute a - placeholdernode. Note that this is stateful:- Interpretermaintains an internal iterator over arguments passed to- runand this method returns next() on that iterator.- Parameters
- target (Target) – The call target for this node. See Node for details on semantics 
- args (Tuple) – Tuple of positional args for this invocation 
- kwargs (Dict) – Dict of keyword arguments for this invocation 
 
- Returns
- The argument value that was retrieved. 
- Return type
- Any 
 - Note - Backwards-compatibility for this API is guaranteed. 
 - run(*args, initial_env=None, enable_io_processing=True)[source]#
- Run module via interpretation and return the result. - Parameters
- *args – The arguments to the Module to run, in positional order 
- initial_env (Optional[Dict[Node, Any]]) – An optional starting environment for execution. This is a dict mapping Node to any value. This can be used, for example, to pre-populate results for certain Nodes so as to do only partial evaluation within the interpreter. 
- enable_io_processing (bool) – If true, we process the inputs and outputs with graph’s process_inputs and process_outputs function first before using them. 
 
- Returns
- The value returned from executing the Module 
- Return type
- Any 
 - Note - Backwards-compatibility for this API is guaranteed.