Tensor Comprehensions
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dlpack.h File Reference
#include <iostream>
#include <memory>
#include <sstream>
#include <string>
#include <vector>
#include <glog/logging.h>
#include <dlpack/dlpack.h>
#include "tc/core/utils/dlpack-inl.h"
Include dependency graph for dlpack.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tc::dlutils::DLTensorDeleter
 

Namespaces

 tc
 
 tc::dlutils
 

Typedefs

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

Functions

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