TensorInfo
- class TensorInfo(info: Optional[TensorInfo] = None)
Represents information about a tensor, including its shape, data type, memory layout, and other relevant attributes. This class provides methods to retrieve tensor information.
- Attributes:
tcim_numpy_map (dict) -- The supported data types of the tensor in the current
TensorInfoobject.pytcim.INT8: np.int8
pytcim.UINT8: np.uint8
pytcim.INT16: np.int16
pytcim.UINT16: np.uint16
pytcim.INT32: np.int32
pytcim.UINT32: np.uint32
pytcim.FLOAT16: np.float16
pytcim.FLOAT32: np.float32
numpy_tcim_map (dict) -- The supported target data types that the tensor of the current
TensorInfoobject can be converted to.np.int8: pytcim.INT8
np.uint8: pytcim.UINT8
np.int16: pytcim.INT16
np.uint16: pytcim.UINT16
np.int32: pytcim.INT32
np.uint32: pytcim.UINT32
np.float16: pytcim.FLOAT16
np.float32: pytcim.FLOAT32
Constructor for the TensorInfo class.
Methods
Constructor for the TensorInfo class.
Creates a
TensorInfoobject with updated memory layout information to contiguous for the tensor.Updates the data type of the tensor in the current
TensorInfoobject.Creates a
TensorInfoobject for a non-image (ND) tensor with the specified shape, data type, and stride.Creates a
TensorInfoobject for a YUV image with the specified batch size, width, height, and format.Retrieves the data type of the tensor associated with the current
TensorInfoobject.Retrieves the data format of the tensor associated with the current
TensorInfoobject.Checks if the tensor data associated with the current
TensorInfohas a contiguous memory layout.Retrieves the memory size (in bytes) allocated for the tensor associated with the current
TensorInfoobject.Creates a
TensorInfoobject for a merged YUV tensor with the given tensor information of Y tensor (Y component) and UV tensor (UV component).Retrieves the shape of the tensor associated with the current
TensorInfoobject.Retrieves the stride of the tensor associated with the current
TensorInfoobject.