Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
arrow::Tensor Class Reference

#include <tensor.h>

Public Member Functions

virtual ~Tensor ()=default
 
 Tensor (const std::shared_ptr< DataType > &type, const std::shared_ptr< Buffer > &data, const std::vector< int64_t > &shape)
 Constructor with no dimension names or strides, data assumed to be row-major. More...
 
 Tensor (const std::shared_ptr< DataType > &type, const std::shared_ptr< Buffer > &data, const std::vector< int64_t > &shape, const std::vector< int64_t > &strides)
 Constructor with non-negative strides. More...
 
 Tensor (const std::shared_ptr< DataType > &type, const std::shared_ptr< Buffer > &data, const std::vector< int64_t > &shape, const std::vector< int64_t > &strides, const std::vector< std::string > &dim_names)
 Constructor with strides and dimension names. More...
 
std::shared_ptr< DataTypetype () const
 
std::shared_ptr< Bufferdata () const
 
const uint8_t * raw_data () const
 
uint8_t * raw_data ()
 
const std::vector< int64_t > & shape () const
 
const std::vector< int64_t > & strides () const
 
int ndim () const
 
const std::string & dim_name (int i) const
 
int64_t size () const
 Total number of value cells in the tensor. More...
 
bool is_mutable () const
 Return true if the underlying data buffer is mutable. More...
 
bool is_contiguous () const
 Either row major or column major. More...
 
bool is_row_major () const
 AKA "C order". More...
 
bool is_column_major () const
 AKA "Fortran order". More...
 
Type::type type_id () const
 
bool Equals (const Tensor &other) const
 

Protected Member Functions

 Tensor ()
 

Protected Attributes

std::shared_ptr< DataTypetype_
 
std::shared_ptr< Bufferdata_
 
std::vector< int64_t > shape_
 
std::vector< int64_t > strides_
 
std::vector< std::string > dim_names_
 These names are optional. More...
 

Constructor & Destructor Documentation

◆ ~Tensor()

virtual arrow::Tensor::~Tensor ( )
virtualdefault

◆ Tensor() [1/4]

arrow::Tensor::Tensor ( const std::shared_ptr< DataType > &  type,
const std::shared_ptr< Buffer > &  data,
const std::vector< int64_t > &  shape 
)

Constructor with no dimension names or strides, data assumed to be row-major.

◆ Tensor() [2/4]

arrow::Tensor::Tensor ( const std::shared_ptr< DataType > &  type,
const std::shared_ptr< Buffer > &  data,
const std::vector< int64_t > &  shape,
const std::vector< int64_t > &  strides 
)

Constructor with non-negative strides.

◆ Tensor() [3/4]

arrow::Tensor::Tensor ( const std::shared_ptr< DataType > &  type,
const std::shared_ptr< Buffer > &  data,
const std::vector< int64_t > &  shape,
const std::vector< int64_t > &  strides,
const std::vector< std::string > &  dim_names 
)

Constructor with strides and dimension names.

◆ Tensor() [4/4]

arrow::Tensor::Tensor ( )
inlineprotected

Member Function Documentation

◆ data()

std::shared_ptr<Buffer> arrow::Tensor::data ( ) const
inline

◆ dim_name()

const std::string & arrow::Tensor::dim_name ( int  i) const

◆ Equals()

bool arrow::Tensor::Equals ( const Tensor other) const

◆ is_column_major()

bool arrow::Tensor::is_column_major ( ) const

AKA "Fortran order".

◆ is_contiguous()

bool arrow::Tensor::is_contiguous ( ) const

Either row major or column major.

◆ is_mutable()

bool arrow::Tensor::is_mutable ( ) const
inline

Return true if the underlying data buffer is mutable.

◆ is_row_major()

bool arrow::Tensor::is_row_major ( ) const

AKA "C order".

◆ ndim()

int arrow::Tensor::ndim ( ) const
inline

◆ raw_data() [1/2]

const uint8_t* arrow::Tensor::raw_data ( ) const
inline

◆ raw_data() [2/2]

uint8_t* arrow::Tensor::raw_data ( )
inline

◆ shape()

const std::vector<int64_t>& arrow::Tensor::shape ( ) const
inline

◆ size()

int64_t arrow::Tensor::size ( ) const

Total number of value cells in the tensor.

◆ strides()

const std::vector<int64_t>& arrow::Tensor::strides ( ) const
inline

◆ type()

std::shared_ptr<DataType> arrow::Tensor::type ( ) const
inline

◆ type_id()

Type::type arrow::Tensor::type_id ( ) const

Member Data Documentation

◆ data_

std::shared_ptr<Buffer> arrow::Tensor::data_
protected

◆ dim_names_

std::vector<std::string> arrow::Tensor::dim_names_
protected

These names are optional.

◆ shape_

std::vector<int64_t> arrow::Tensor::shape_
protected

◆ strides_

std::vector<int64_t> arrow::Tensor::strides_
protected

◆ type_

std::shared_ptr<DataType> arrow::Tensor::type_
protected

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