tvm_ffi.Shape

tvm_ffi.Shape#

class tvm_ffi.Shape(content)[source]#

Bases: tuple, PyNativeObject

Shape tuple that represents tvm::ffi::Shape returned by an FFI call.

Notes

This class subclasses tuple so it can be used in most places where tuple is used in Python array APIs.

Examples

import numpy as np
import tvm_ffi

x = tvm_ffi.from_dlpack(np.arange(6, dtype="int32").reshape(2, 3))
assert x.shape == (2, 3)
Parameters:

content (tuple[int, ...])

Return type:

Shape

__init__()#