thunder.core.proxies.TensorProxy

class thunder.core.proxies.TensorProxy(name=None, *, like=None, shape=None, device=None, dtype=None, requires_grad=False, grad=None, prefix=None, distparallel_type=None, history=None, tags=None, thunder_fsdp_padding_size=None)[source]

Bases: Proxy, TensorProxyInterface

Parameters:
__init__(name=None, *, like=None, shape=None, device=None, dtype=None, requires_grad=False, grad=None, prefix=None, distparallel_type=None, history=None, tags=None, thunder_fsdp_padding_size=None)[source]
Parameters:

Methods

__init__([name, like, shape, device, dtype, ...])

float()

get_default_attr(attr, /)

rtype:

Optional[Any]

get_default_prefix()

rtype:

str

replace(**changes)

Return a copy of the TensorProxy object with new values for the specified fields as given to the constructor as arguments.

replace_name([name, disambiguate])

Return a copy of this proxy with the given name.

type_string()

Attributes

T

device

distparallel_type

dtype

grad

imag

mT

name

ndim

prefix

Return the prefix for this proxy instance.

real

requires_grad

shape

tags

thunder_fsdp_padding_size

true_dtype

replace(**changes)[source]

Return a copy of the TensorProxy object with new values for the specified fields as given to the constructor as arguments. Valid keyword arguments are name, history, shape, dtype, device, requires_grad, distparallel_type, thunder_fsdp_padding_size. like is also a valid keyword and will take metadata from the tensor proxy argument in preference to the old values but overridable by keyword arguments. Note that the copy will use the current (environment) tracectx.