|
| Tensor (const Tensor &)=delete |
|
Tensor & | operator= (const Tensor &)=delete |
|
| Tensor (Tensor &&)=default |
|
Tensor & | operator= (Tensor &&)=default |
|
| operator bool () const |
|
TensorImpl * | unsafeGetTensorImpl () const |
|
Tensor | UnsafeSharedInstance () const |
|
| Tensor (at::Device device) |
| Creates a tensor of the given device type. More...
|
|
| Tensor (at::IntArrayRef dims, DeviceType type) |
| Creates a tensor of the given dimension. More...
|
|
| Tensor (at::IntArrayRef dims, at::Device device) |
|
| Tensor (const vector< int > &dims, DeviceType type) |
|
| Tensor (const Tensor &src, DeviceType type) |
| : Create a Tensor of at::DeviceType type and initialize it with src Tensor
|
|
| Tensor (const at::Tensor &tensor) |
| Mutual conversion with at::Tensor. More...
|
|
| operator at::Tensor () const & |
|
| operator at::Tensor ()&& |
|
| Tensor (C10Tensor tensor) |
| Mutual conversion with C10Tensor. More...
|
|
| operator C10Tensor () const & |
|
| operator C10Tensor ()&& |
|
bool | is_same (const Tensor &other) const noexcept |
|
Tensor | Clone () const |
|
Tensor | Alias () const |
| Clone self as a Tensor that share the same Storage, that is, both Tensors are views on the same Storage. More...
|
|
DeviceType | GetDeviceType () const |
|
at::Device | GetDevice () const |
|
void | CopyFrom (const Tensor &src, bool async=false) |
| Copies the data from a source tensor, with a contex provided to carry out the underlying memcpy operation. More...
|
|
void | ExtendTo (int64_t num, float growthPct) const |
| Extend the outer-most dimension of this tensor to dimension of num .
|
|
void | Extend (int64_t num, float growthPct) const |
|
void | ShrinkTo (int64_t outer_dim) const |
| Shrinks the outer-most dimension to given size, keeping the data. More...
|
|
template<class T > |
void | ReserveSpace (const T &outer_dim) const |
|
template<typename... Ts> |
void | Resize (Ts...dim_source) const |
|
void | ResizeLike (const Tensor &src_tensor) const |
| Resize the tensor like the source tensor. More...
|
|
void | Reshape (const vector< int64_t > &dims) const |
|
void | Reshape (const vector< int > &dims) const |
|
void | FreeMemory () const |
|
string | DebugString () const |
| A utility function to print the debug string for the tensor. More...
|
|
void | ShareData (const Tensor &src) const |
|
template<typename T > |
void | ShareExternalPointer (T *src, size_t capacity=0, MemoryDeleter d=nullptr) const |
| Shares the data with an externally managed pointer. More...
|
|
template<typename T > |
void | ShareExternalPointer (at::DataPtr &&data_ptr, size_t capacity=0) const |
|
void | ShareExternalPointer (void *src, const TypeMeta &data_type, size_t capacity=0, MemoryDeleter d=nullptr) const |
|
void | ShareExternalPointer (at::DataPtr &&data_ptr, const TypeMeta &data_type, size_t capacity) |
|
const c10::intrusive_ptr< TensorImpl, UndefinedTensorImpl > & | getIntrusivePtr () const |
|
bool | defined () const |
|
void * | raw_data () const |
| Returns a raw void* pointer of the underlying storage. More...
|
|
template<typename T > |
T * | data () const |
|
void * | raw_mutable_data (const TypeMeta &meta) const |
|
void * | raw_mutable_data () const |
| Returns a mutable raw pointer of the underlying storage. More...
|
|
template<typename T > |
T * | mutable_data () const |
|
int | dim () const |
| Returns the number of dimensions of the data.
|
|
int | ndim () const |
| (To be deprecated) Returns the number of dimensions of the data.
|
|
int64_t | size () const |
| (To be deprecated) Returns the size (i.e. More...
|
|
int64_t | numel () const |
| Returns the number of items of the tensor.
|
|
size_t | itemsize () const |
| Return the number of bytes each item takes in the tensor.
|
|
size_t | nbytes () const |
| Returns the total number of bytes of the storage. More...
|
|
at::IntArrayRef | sizes () const |
|
int64_t | size_from_dim (int k) const |
|
int64_t | size_to_dim (int k) const |
|
int64_t | size_between_dim (int k, int l) const |
|
int | canonical_axis_index (int axis_index) const |
| Returns the 'canonical' version of a (usually) user-specified axis, allowing for negative indexing (e.g., -1 for the last axis). More...
|
|
int64_t | stride (int64_t dim) const |
|
at::IntArrayRef | strides () const |
|
bool | is_contiguous () const |
|
template<typename T > |
bool | IsType () const |
| Checks if the tensor content is of the given data type.
|
|
const TypeMeta & | dtype () const |
| Returns the TypeMeta object associated with the current data type.
|
|
const TypeMeta & | meta () const |
| (To be deprecated) Returns the TypeMeta object associated with the current data type.
|
|
int | dim32 (const int i) const |
| Returns the i-th dimension of the tensor in int. More...
|
|
int64_t | size (const int i) const |
|
int64_t | dim (const int i) const |
|
const Storage & | storage () |
|
const Storage & | storage () const |
|
bool | storage_initialized () const |
|
bool | dtype_initialized () const |
|
Tensor class holds a shared pointer to the implementation TensorImpl, redirects API calls to TensorImpl; Copying of Tensor results in sharing the same underlying implementation object.
NB: See TensorImpl for documentation on these methods.
Definition at line 25 of file tensor.h.