17 #include <boost/assert.hpp> 33 BOOST_ASSERT(CompatibleTypes<T>(
GetTensorInfo().GetDataType()));
34 return reinterpret_cast<const T*
>(m_Memory);
46 virtual const void*
Map(
bool )
const override {
return m_Memory; }
47 virtual void Unmap()
const override {}
62 void CopyOutTo(
void *)
const override { BOOST_ASSERT_MSG(
false,
"Unimplemented"); }
63 void CopyInFrom(
const void*)
override { BOOST_ASSERT_MSG(
false,
"Unimplemented"); }
73 const void* ConstCpuTensorHandle::GetConstTensor<void>()
const;
82 BOOST_ASSERT(CompatibleTypes<T>(
GetTensorInfo().GetDataType()));
83 return reinterpret_cast<T*
>(m_MutableMemory);
91 m_MutableMemory = mem;
99 void* m_MutableMemory;
103 void* CpuTensorHandle::GetTensor<void>()
const;
125 void CopyOutTo(
void* memory)
const override;
126 void CopyInFrom(
const void* memory)
override;
129 void CopyFrom(
const void* srcMemory,
unsigned int numBytes);
const T * GetConstTensor() const
const TensorInfo & GetTensorInfo() const
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
ConstCpuTensorHandle(const TensorInfo &tensorInfo)
virtual void Manage() override
PassthroughCpuTensorHandle(const TensorInfo &tensorInfo, void *mem)
ConstPassthroughCpuTensorHandle(const TensorInfo &tensorInfo, const void *mem)
TensorShape GetStrides() const override
void SetMemory(void *mem)
TensorShape GetShape() const override
virtual ITensorHandle * GetParent() const override
TensorShape GetUnpaddedTensorStrides(const TensorInfo &tensorInfo)
void SetConstMemory(const void *mem)
virtual const void * Map(bool) const override
virtual void Allocate()=0
virtual void Unmap() const override
Unmap the tensor data.
const TensorShape & GetShape() const