Skip to content
class

ModuleHookTensorMeta

ModuleHookTensorMeta

Minimal tensor metadata snapshot retained by the hook barriers.

The barrier nodes capture only Shape / Dtype / Device at wrap time so that incoming Storage gradients can later be rehydrated into a proper TensorImpl when crossing into Python user code (which expects Tensor objects, not raw buffers). Keeping the data tensor itself out of the state avoids keeping the forward outputs alive any longer than the normal autograd path would.

Attributes

shapeShape
Logical shape of the represented tensor.
dtypeDtype, default Dtype::F32
Element type for the eventual reconstructed tensor.
deviceDevice, default Device::CPU
Stream / placement of the tensor when handed back to Python.