thunder.core.symbol.BoundSymbol¶
- class thunder.core.symbol.BoundSymbol(sym, args, kwargs, output, subsymbols=(), header='', source_filename=None, source_positions=None, tags=<factory>, _call_ctx=None, _import_ctx=<factory>, _object_ctx=<factory>, _executor=None, _line_no=None)[source]¶
Bases:
BoundSymbolInterface- Parameters:
sym (Symbol) –
args (tuple) –
kwargs (dict) –
output (Any) –
subsymbols (Sequence[BoundSymbol]) –
source_filename (str | None) –
source_positions (thunder.core.codeutils.Positions | None) –
tags (set[thunder.core.symbol.BoundSymbolTag]) –
_import_ctx (dict) –
_object_ctx (dict) –
_line_no (None | int) –
- __init__(sym, args, kwargs, output, subsymbols=(), header='', source_filename=None, source_positions=None, tags=<factory>, _call_ctx=None, _import_ctx=<factory>, _object_ctx=<factory>, _executor=None, _line_no=None)[source]¶
Methods
__init__(sym, args, kwargs, output[, ...])from_bsym(**kwargs)- rtype:
from_bsym_swap_proxies(swap_map[, ...])Create a new
BoundSymbolwith its inputs, output, and subsymbols updated withswap_map.gather_ctxs()has_input(coll)- rtype:
import_ctx()name_with_module()object_ctx()python(indent[, commented, print_depth])Attributes
Returns True if all arguments are constant (i.e.
flat_argsflat_args_and_specflat_outsflat_outs_and_specflat_proxy_argsflat_proxy_outsflat_variableified_proxy_argsflat_variableified_proxy_outsheaderrhssource_filenamesource_positionssubsymbolssymargskwargsoutputtags- from_bsym_swap_proxies(swap_map, skip_inputs=False, skip_output=False, skip_subsymbols=False)[source]¶
Create a new
BoundSymbolwith its inputs, output, and subsymbols updated withswap_map.This replaces :class:
Proxy``s, e.g. :class:`TensorProxy`, of inputs and output with another ones already seen recorded in ``swap_map(swap_mapmaps variableified :class:Proxyto an existing one generated by the same expression), and do the same to subsymbols.Turning on some of positional arguments following
swap_mapcan be useful, for example, when querying right-hand side expression of aBoundSymbolinthunder.executors.passes.CSE().