Rate this Page

TensorMetadata#

class torch.fx.passes.shape_prop.TensorMetadata(shape, dtype, requires_grad, stride, memory_format, is_quantized, qparams)[source]#

A structure containing pertinent information about a tensor within a PyTorch program.

Note

Backwards-compatibility for this API is guaranteed.

count(value, /)#

Return number of occurrences of value.

dtype: dtype#

Alias for field number 1

index(value, start=0, stop=9223372036854775807, /)#

Return first index of value.

Raises ValueError if the value is not present.

is_quantized: bool#

Alias for field number 5

memory_format: memory_format | None#

Alias for field number 4

qparams: dict[str, Any]#

Alias for field number 6

requires_grad: bool#

Alias for field number 2

shape: Size#

Alias for field number 0

stride: tuple[int, ...]#

Alias for field number 3