Class AMSTensor¶
Defined in File AMSTensor.hpp
Class Documentation¶
-
class AMSTensor¶
-
Public Functions
-
~AMSTensor() = default¶
-
inline IntDimType elements() const¶
-
inline IntDimType element_size() const¶
-
inline size_t nbytes() const¶
-
inline size_t storage_nbytes() const¶
-
inline size_t dim() const¶
-
inline AMSResourceType location() const¶
-
inline ArrayRef<IntDimType> strides() const¶
-
inline ArrayRef<IntDimType> shape() const¶
-
inline ArrayRef<IntDimType> sizes() const¶
-
inline bool contiguous() const¶
-
inline bool writable() const¶
-
inline bool valid() const noexcept¶
-
inline LifetimeToken lifetimeToken() const¶
-
inline void *data_ptr()¶
-
inline const void *data_ptr() const¶
-
AMSTensor transpose(IntDimType axis1 = 0, IntDimType axis2 = 1)¶
-
AMSTensor transpose(IntDimType axis1 = 0, IntDimType axis2 = 1) const¶
Public Static Functions
-
template<typename ScalarType>
static AMSTensor create(ArrayRef<IntDimType> shapes, ArrayRef<IntDimType> strides, AMSResourceType location)¶
-
template<typename ScalarType>
static AMSTensor view(ScalarType *data, ArrayRef<IntDimType> shapes, ArrayRef<IntDimType> strides, AMSResourceType location)¶ Borrow memory. The caller remains responsible for its lifetime/capacity.
-
template<typename ScalarType>
static AMSTensor view(ScalarType *data, ArrayRef<IntDimType> shapes, ArrayRef<IntDimType> strides, AMSResourceType location, LifetimeToken lifetime)¶ View foreign memory and retain the supplied foreign-storage owner.
-
~AMSTensor() = default¶