Tensor Comprehensions
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
tc::dlutils Namespace Reference

Classes

struct  DLTensorDeleter
 

Typedefs

typedef std::shared_ptr< DLTensor > DLTensorSPtr
 
typedef std::unique_ptr
< DLTensor, DLTensorDeleter
DLTensorUPtr
 

Functions

std::string toString (const DLDataType &t)
 
DLContext getCPUDLContext ()
 
DLContext getGPUDLContext (int device_id)
 
template<typename T >
DLDataType getDLDataType ()
 
template<>
DLDataType getDLDataType< float > ()
 
template<>
DLDataType getDLDataType< int > ()
 
void SetSizes (DLTensor &t, const std::vector< int64_t > &sizes)
 
void SetStrides (DLTensor &t, const std::vector< int64_t > &strides)
 
void SetStridesFromSizes (DLTensor &t, const std::vector< int64_t > &)
 
DLTensorUPtr makeDLTensorWithSizes (DLContext ctx, DLDataType dtype, const std::vector< int64_t > &sizes)
 
std::vector< const DLTensor * > extractRawPtrs (const std::vector< DLTensorUPtr > &uptrs)
 
std::vector< const DLTensor * > constPtrs (const std::vector< DLTensor * > &ptrs)
 
DLTensorUPtr makeDLTensor (const DLTensor *ptr)
 
template<typename T >
std::vector< DLTensorUPtrmakeDLTensorVector (const std::vector< T * > &ptrs)
 
std::string toString (const DLTensor &t)
 
bool operator== (const DLDataType &t1, const DLDataType &t2)
 
std::ostream & operator<< (std::ostream &os, const DLDataType &t)
 
bool compareDLTensorMetadata (const DLTensor &t1, const DLTensor &t2)
 
template<typename T , typename TT >
bool compareDLTensorVectorMetadata (const std::vector< T * > &v1, const std::vector< TT * > &v2)
 
std::ostream & operator<< (std::ostream &os, const DLTensor &t)
 

Typedef Documentation

typedef std::shared_ptr<DLTensor> tc::dlutils::DLTensorSPtr
typedef std::unique_ptr<DLTensor, DLTensorDeleter> tc::dlutils::DLTensorUPtr

Function Documentation

bool tc::dlutils::compareDLTensorMetadata ( const DLTensor &  t1,
const DLTensor &  t2 
)
inline
template<typename T , typename TT >
bool tc::dlutils::compareDLTensorVectorMetadata ( const std::vector< T * > &  v1,
const std::vector< TT * > &  v2 
)
std::vector< const DLTensor * > tc::dlutils::constPtrs ( const std::vector< DLTensor * > &  ptrs)
inline
std::vector< const DLTensor * > tc::dlutils::extractRawPtrs ( const std::vector< DLTensorUPtr > &  uptrs)
inline
DLContext tc::dlutils::getCPUDLContext ( )
inline
template<typename T >
DLDataType tc::dlutils::getDLDataType ( )
template<>
DLDataType tc::dlutils::getDLDataType< float > ( )
inline
template<>
DLDataType tc::dlutils::getDLDataType< int > ( )
inline
DLContext tc::dlutils::getGPUDLContext ( int  device_id)
inline
DLTensorUPtr tc::dlutils::makeDLTensor ( const DLTensor *  ptr)
inline
template<typename T >
std::vector< DLTensorUPtr > tc::dlutils::makeDLTensorVector ( const std::vector< T * > &  ptrs)
DLTensorUPtr tc::dlutils::makeDLTensorWithSizes ( DLContext  ctx,
DLDataType  dtype,
const std::vector< int64_t > &  sizes 
)
inline
std::ostream& tc::dlutils::operator<< ( std::ostream &  os,
const DLTensor &  t 
)
std::ostream & tc::dlutils::operator<< ( std::ostream &  os,
const DLDataType &  t 
)
inline
bool tc::dlutils::operator== ( const DLDataType &  t1,
const DLDataType &  t2 
)
inline
void tc::dlutils::SetSizes ( DLTensor &  t,
const std::vector< int64_t > &  sizes 
)
inline
void tc::dlutils::SetStrides ( DLTensor &  t,
const std::vector< int64_t > &  strides 
)
inline
void tc::dlutils::SetStridesFromSizes ( DLTensor &  t,
const std::vector< int64_t > &   
)
inline
std::string tc::dlutils::toString ( const DLDataType &  t)
inline
std::string tc::dlutils::toString ( const DLTensor &  t)
inline