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:
name (str | None) –
like (TensorProxy | FutureTensorProxy | None) –
shape (ShapeLike | None) –
device (devices.Device | None) –
dtype (dtypes.dtype | None) –
requires_grad (bool) –
grad (TensorProxy | None) –
prefix (None | str) –
distparallel_type (DistParallelType | None) –
history (None | tuple) –
tags (set | None) –
thunder_fsdp_padding_size (int | None) –
- __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:
like (Optional[Union[TensorProxy, FutureTensorProxy]]) –
requires_grad (bool) –
grad (Optional[TensorProxy]) –
distparallel_type (Optional[DistParallelType]) –
Methods
__init__
([name, like, shape, device, dtype, ...])float
()get_default_attr
(attr, /)get_default_prefix
()- rtype:
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.