def shape(self): """A list containing sizes for each dimension. Returns: List[Int]: The result list. """ dim = _ti_core.get_external_tensor_dim(self.ptr) ret = [ Expr(_ti_core.get_external_tensor_shape_along_axis(self.ptr, i)) for i in range(dim) ] return ret
def shape(self): """A list containing sizes for each dimension. Note that element shape will be excluded. Returns: List[Int]: The result list. """ dim = _ti_core.get_external_tensor_dim(self.ptr) ret = [ Expr(_ti_core.get_external_tensor_shape_along_axis(self.ptr, i)) for i in range(dim) ] element_dim = len(self.element_shape) if element_dim == 0: return ret return ret[ element_dim:] if self.layout == Layout.SOA else ret[:-element_dim]
def get_external_tensor_dim(var): return _ti_core.get_external_tensor_dim(var)