Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions | Static Public Member Functions | Data Fields
torch::autograd::VariableType Struct Referencefinal
Inheritance diagram for torch::autograd::VariableType:
at::TypeDefault at::TypeExtendedInterface c10::Type

Public Member Functions

 VariableType (Context *context, at::TypeExtendedInterface *baseType)
 
at::ScalarType scalarType () const override
 
caffe2::TypeMeta typeMeta () const override
 
at::Backend backend () const override
 
at::Allocatorallocator () const override
 
at::Device getDeviceFromPtr (void *data) const override
 
Storage storageFromBlob (void *data, int64_t size, const std::function< void(void *)> &deleter) const override
 
Storage storageWithAllocator (int64_t size, at::Allocator *allocator) const override
 
std::unique_ptr< at::Generatorgenerator () const override
 
const char * toString () const override
 
at::TypeID ID () const override
 
at::TypetoBackend (at::Backend b) const override
 
at::TypetoScalarType (at::ScalarType s) const override
 
Storage unsafeStorageFromTH (void *th_pointer, bool retain) const override
 
at::Tensor unsafeTensorFromTH (void *th_pointer, bool retain) const override
 
void backward (Tensor &self, c10::optional< Tensor > gradient, bool keep_graph, bool create_graph) const override
 
void set_data (Tensor &self, Tensor new_data) const override
 
- Public Member Functions inherited from at::TypeDefault
 TypeDefault (TensorTypeId type_id, bool is_variable, bool is_undefined)
 
bool is_cuda () const override
 
bool is_hip () const override
 
bool is_sparse () const override
 
bool is_distributed () const override
 
TypetoBackend (Backend b) const override
 
TypetoScalarType (ScalarType s) const override
 
Tensor copy (const Tensor &src, bool non_blocking=false, optional< Device > to_device={}) const override
 
Tensorcopy_ (Tensor &self, const Tensor &src, bool non_blocking=false) const override
 
void backward (Tensor &self, c10::optional< Tensor > gradient, bool keep_graph, bool create_graph) const override
 
void set_data (Tensor &self, Tensor new_data) const override
 
Tensor tensorFromBlob (void *data, IntArrayRef sizes, const std::function< void(void *)> &deleter=noop_deleter) const override
 
Tensor tensorFromBlob (void *data, IntArrayRef sizes, IntArrayRef strides, const std::function< void(void *)> &deleter=noop_deleter) const override
 
Tensor tensorWithAllocator (IntArrayRef sizes, Allocator *allocator) const override
 
Tensor tensorWithAllocator (IntArrayRef sizes, IntArrayRef strides, Allocator *allocator) const override
 
Storage storageFromBlob (void *data, int64_t size, const std::function< void(void *)> &deleter) const override
 
Storage storageWithAllocator (int64_t size, Allocator *allocator) const override
 
Storage unsafeStorageFromTH (void *th_pointer, bool retain) const override
 
Tensor unsafeTensorFromTH (void *th_pointer, bool retain) const override
 
- Public Member Functions inherited from at::TypeExtendedInterface
 TypeExtendedInterface (TensorTypeId type_id, bool is_variable, bool is_undefined)
 
- Public Member Functions inherited from c10::Type
virtual bool operator== (const Type &rhs) const =0
 
virtual bool isSubtypeOf (const TypePtr rhs) const
 
virtual bool isSubclass (const TypeKind kind) const =0
 
virtual std::string str () const =0
 
virtual std::string python_str () const
 
TypeKind kind () const
 
virtual bool requires_grad () const
 
template<typename T >
std::shared_ptr< Tcast ()
 
template<typename T >
std::shared_ptr< const Tcast () const
 
template<typename T >
std::shared_ptr< Texpect ()
 
template<typename T >
std::shared_ptr< const Texpect () const
 
virtual bool hasFreeVariables () const
 
virtual at::ArrayRef< TypePtr > containedTypes () const
 
TypePtr withContained (std::vector< TypePtr > contained_types)
 
virtual TypePtr createWithContained (std::vector< TypePtr > contained_types) const
 

Static Public Member Functions

static at::TypeExtendedInterfacegetVariableTypeFromBaseType (const at::Type &baseType)
 
static bool isVariableType (const at::Type &type)
 
static std::vector< at::Type * > allCUDATypes ()
 
static std::vector< at::Type * > allCPUTypes ()
 
static Variablechecked_cast_variable (Tensor &t, const char *name, int pos)
 
static at::Tensorunpack (Tensor &t, const char *name, int pos)
 
static const at::Tensorunpack (const Tensor &t, const char *name, int pos)
 
static at::SparseTensorRef unpack (SparseTensorRef t, const char *name, int pos)
 
static at::Tensor unpack_opt (const Tensor &t, const char *name, int pos)
 
static std::vector< at::Tensorunpack (at::TensorList tl, const char *name, int pos)
 

Data Fields

at::TypeExtendedInterfacebaseType
 
std::string str
 
size_t id_
 

Additional Inherited Members

- Protected Member Functions inherited from c10::Type
 Type (TypeKind kind)
 

Detailed Description

Definition at line 34 of file VariableType.h.


The documentation for this struct was generated from the following files: