Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Types | Public Member Functions
at::MatrixRef< T > Class Template Reference

MatrixRef - Like an ArrayRef, but with an extra recorded strides so that we can easily view it as a multidimensional array. More...

#include <MatrixRef.h>

Public Types

typedef size_t size_type
 

Public Member Functions

 MatrixRef ()
 Construct an empty Matrixref.
 
 MatrixRef (ArrayRef< T > arr, size_type stride0)
 Construct an MatrixRef from an ArrayRef and outer stride.
 
Simple Operations
bool empty () const
 empty - Check if the matrix is empty.
 
const Tdata () const
 
size_t size (size_t dim) const
 size - Get size a dimension
 
size_t numel () const
 
bool equals (MatrixRef RHS) const
 equals - Check for element-wise equality.
 
Operator Overloads
ArrayRef< Toperator[] (size_t Index) const
 
template<typename U >
std::enable_if< std::is_same< U, T >::value, MatrixRef< T > >::type & operator= (U &&Temporary)=delete
 Disallow accidental assignment from a temporary. More...
 
template<typename U >
std::enable_if< std::is_same< U, T >::value, MatrixRef< T > >::type & operator= (std::initializer_list< U >)=delete
 Disallow accidental assignment from a temporary. More...
 

Detailed Description

template<typename T>
class at::MatrixRef< T >

MatrixRef - Like an ArrayRef, but with an extra recorded strides so that we can easily view it as a multidimensional array.

Like ArrayRef, this class does not own the underlying data, it is expected to be used in situations where the data resides in some other buffer.

This is intended to be trivially copyable, so it should be passed by value.

For now, 2D only (so the copies are actually cheap, without having to write a SmallVector class) and contiguous only (so we can return non-strided ArrayRef on index).

P.S. dimension 0 indexes rows, dimension 1 indexes columns

Definition at line 23 of file MatrixRef.h.

Member Function Documentation

template<typename T >
template<typename U >
std::enable_if<std::is_same<U, T>::value, MatrixRef<T> >::type& at::MatrixRef< T >::operator= ( U &&  Temporary)
delete

Disallow accidental assignment from a temporary.

The declaration here is extra complicated so that "arrayRef = {}" continues to select the move assignment operator.

template<typename T >
template<typename U >
std::enable_if<std::is_same<U, T>::value, MatrixRef<T> >::type& at::MatrixRef< T >::operator= ( std::initializer_list< U >  )
delete

Disallow accidental assignment from a temporary.

The declaration here is extra complicated so that "arrayRef = {}" continues to select the move assignment operator.


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