create_nd

static TensorInfo.create_nd(shape: ~typing.List[int], dtype: ~typing.Union[~tcim_lite.pytcim.DataType, type] = <class 'numpy.uint8'>, stride: ~typing.List[int] = [])

Creates a TensorInfo object for a non-image (ND) tensor with the specified shape, data type, and stride.

Parameters:
  • shape (List[int]) -- A list specifying the size of each dimension of the tensor.

  • dtype (Union[DataType, type], optional) -- The data type of the tensor. Defaults to np.uint8. If a Python type, such as np.float32 is provided, it will be mapped to the corresponding internal DataType using TensorInfo.numpy_tcim_map. See TensorInfo for details.

  • stride (List[int], optional) -- The list specifying the stride for each dimension. The stride defines the memory layout and the number of bytes to move between adjacent elements along each dimension. Defaults to an empty list, indicating a contiguous memory layout.

Returns:

tensor_info -- An object representing information about a multi-dimensional non-image tensor.

Return type:

TensorInfo

Raises:

RuntimeError -- If the provided dtype is not supported or if the tensor creation fails.