17#ifndef TMVA_DNN_ARCHITECTURES_CPU_CPUTENSOR 
   18#define TMVA_DNN_ARCHITECTURES_CPU_CPUTENSOR 
   39template <
typename AFloat>
 
  115         if (this->
GetLayout() == MemoryLayout::ColumnMajor) {
 
  116            shape.insert(shape.end(),dim-2, 1);
 
  118            shape.insert(shape.begin(), dim - 2, 1);
 
 
  158      return (this->
GetMemoryLayout() == MemoryLayout::ColumnMajor) ? shape.back() : shape.front();
 
 
  164      if (shape.size() == 2)  
return 1;
 
  165      return (this->
GetMemoryLayout() == MemoryLayout::ColumnMajor) ? shape.front() : shape[1]; 
 
 
  171      if (shape.size() == 2)  
return shape[0];
 
  172      if (shape.size() == 3)  
return (this->
GetMemoryLayout() == MemoryLayout::ColumnMajor) ? shape[0] : shape[1] ;
 
  173      if (shape.size() >= 4)  
return shape[2] ;
 
 
  180      if (shape.size() == 2)  
return shape[1];
 
  181      if (shape.size() == 3)  
return (this->
GetMemoryLayout() == MemoryLayout::ColumnMajor) ? shape[1] : shape[2] ;
 
  182      if (shape.size() >= 4)  
return shape[3] ;
 
 
  215      x.ReshapeInplace(shape);
 
 
  226                                                                   : 
Shape_t(shape.begin(), shape.end() - 1);
 
 
  239         return At(i).GetMatrix();
 
 
  246         for (
size_t i = 0; i < this->
GetSize(); ++i)
 
 
  254         assert(shape.size() == 2);
 
 
  264         assert(shape.size() == 3);
 
  267                   ? (*(this->
GetContainer()))[i * shape[1] * shape[2] + 
j * shape[2] + k]
 
  268                   : (*(this->
GetContainer()))[i * shape[0] * shape[1] + k * shape[0] + 
j]; 
 
 
  275         assert(shape.size() == 2);
 
  277                                                                    : (this->
GetData())[j * shape[0] + i];
 
 
  283         assert(shape.size() == 3);
 
  286                   ? (this->
GetData())[i * shape[1] * shape[2] + 
j * shape[2] + k]
 
  287                   : (this->
GetData())[i * shape[0] * shape[1] + k * shape[0] + 
j]; 
 
 
  292      template <
typename Function_t>
 
  297      template <
typename Function_t>
 
  306         for (
size_t i = 0; i < this->
GetSize(); i++)
 
  307            std::cout << (this->
GetData())[i] << 
"  ";
 
  308         std::cout << std::endl;
 
 
  312         std::string 
memlayout = (
GetLayout() == MemoryLayout::RowMajor) ? 
"RowMajor" : 
"ColMajor";
 
  313         std::cout << 
name << 
" shape : { ";
 
  315         for (
size_t i = 0; i < shape.size() - 1; ++i)
 
  316            std::cout << shape[i] << 
" , ";
 
  317         std::cout << shape.back() << 
" } " 
  318                   << 
" Layout : " << 
memlayout << std::endl;
 
 
 
  323template <
typename AFloat>
 
  324template <
typename Function_t>
 
  327   AFloat *
data = GetRawDataPointer();
 
 
  352template <
typename AFloat>
 
  353template <
typename Function_t>
 
  356   AFloat *
dataB = GetRawDataPointer();
 
  357   const AFloat *
dataA = A.GetRawDataPointer();
 
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
 
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
 
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
 
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
 
static Config & Instance()
static function: returns TMVA instance
 
static size_t GetNWorkItems(size_t nelements)
 
size_t GetBufferUseCount() const
 
AFloat operator()(size_t i, size_t j, size_t k) const
 
TCpuTensor(size_t n, size_t m, MemoryLayout memlayout=MemoryLayout::ColumnMajor)
constructors from n m
 
TCpuTensor(size_t bsize, size_t depth, size_t height, size_t width, MemoryLayout memlayout=MemoryLayout::ColumnMajor)
constructors from batch size, depth, height, width
 
AFloat * GetRawDataPointer()
Return raw pointer to the elements stored contiguously in column-major order.
 
size_t GetNoElements() const
 
void Map(Function_t &f)
Map the given function over the matrix elements.
 
const TCpuBuffer< AFloat > & GetDeviceBuffer() const
 
TCpuTensor(size_t bsize, size_t depth, size_t hw, MemoryLayout memlayout=MemoryLayout::ColumnMajor)
constructors from batch size, depth, height*width
 
TCpuMatrix< AFloat > operator[](size_t i) const
 
const AFloat * GetRawDataPointer() const
 
TCpuBuffer< AFloat > & GetDeviceBuffer()
 
AFloat & operator()(size_t i, size_t j, size_t k)
 
TCpuTensor(const TCpuBuffer< AFloat > &buffer, Shape_t shape, MemoryLayout memlayout=MemoryLayout::ColumnMajor)
constructors from a TCpuBuffer and a shape
 
void MapFrom(Function_t &f, const TCpuTensor< AFloat > &A)
Same as maps but takes the input values from the tensor A and writes the results in this tensor.
 
AFloat operator()(size_t i, size_t j) const
 
TCpuTensor(const TCpuMatrix< AFloat > &matrix, size_t dim=3, MemoryLayout memlayout=MemoryLayout::ColumnMajor)
constructors from a TCpuMatrix.
 
TCpuMatrix< AFloat > GetMatrix() const
 
TCpuTensor< AFloat > At(size_t i) const
 
TCpuTensor(Shape_t shape, MemoryLayout memlayout=MemoryLayout::ColumnMajor)
constructors from a shape.
 
size_t GetFirstSize() const
 
void PrintShape(const char *name="Tensor") const
 
AFloat & operator()(size_t i, size_t j)
 
TCpuTensor< AFloat > At(size_t i)
 
friend class TCpuMatrix< AFloat >
 
MemoryLayout GetLayout() const
 
void Print(const char *name="Tensor") const
 
TCpuTensor< AFloat > Reshape(Shape_t shape) const
 
typename TMVA::Experimental::RTensor< AFloat >::Shape_t Shape_t
 
TCpuTensor(AFloat *data, const Shape_t &shape, MemoryLayout memlayout=MemoryLayout::ColumnMajor)
 
RTensor is a container with contiguous memory and shape information.
 
void ReshapeInplace(const Shape_t &shape)
Reshape tensor in place.
 
MemoryLayout GetMemoryLayout() const
 
std::shared_ptr< Container_t > GetContainer()
 
const Shape_t & GetStrides() const
 
std::size_t GetSize() const
 
RTensor(Value_t *data, Shape_t shape, MemoryLayout layout=MemoryLayout::RowMajor)
Construct a tensor as view on data.
 
const Shape_t & GetShape() const
 
std::vector< std::size_t > Shape_t
 
MemoryLayout
Memory layout type (copy from RTensor.hxx)
 
create variable transformations