Struct executorch_sys::torch::executor::TensorImpl
source · #[repr(C, align(8))]pub struct TensorImpl {
pub _bindgen_opaque_blob: [u64; 8],
}Expand description
Manages the storage behind an ETensor (torch::executor::Tensor).
Note that instances of this class do not own the arrays given to it (sizes/strides/data), which means that the caller must guarantee that they live longer than a given instance of this class.
Note on types:
Code that uses ETensor should also be able to build against at::Tensor. So, although the overlapping APIs don’t need to be exactly the same, their types should be semantically similar.
Many of the methods in at::Tensor use int64_t for parameter and return types. This can be a waste when building for 32-bit environments. So, TensorImpl and ETensor use ssize_t instead: like int64_t it is signed, but it will match the native word size of the target architecture. This will avoid unnecessarily expensive uses of 64-bit integers on 32-bit machines.
But, since the types are not identical, code that uses ETensor needs to be
generic about the local types it uses when working with these methods. In
most cases, auto will do the trick. In the worst case, code can be guarded
with #ifdef USE_ATEN_LIB.
Fields§
§_bindgen_opaque_blob: [u64; 8]