LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
lbann::utils::details Namespace Reference

Classes

class  IsBuiltinArchiveT
 Predicate for testing if the given type is a built-in Cereal archive. More...
 
class  MatrixAsTensorView
 Interpret a matrix as a tensor. More...
 
class  MatrixReferenceWrapper
 Manage a reference to a (possibly const) matrix. More...
 
struct  SafeMatrixCaster
 
struct  SafeMatrixCaster< El::Matrix< OutDataType, D >, El::AbstractMatrix< InDataType > >
 

Functions

template<typename MatrixT >
std::vector< size_t > get_tensor_dims (MatrixT const &A)
 Interpret the matrix as a tensor and return the tensor-ized dimensions. More...
 
template<typename T >
std::vector< size_t > localize_dims (El::AbstractDistMatrix< T > const &A, std::vector< size_t > const &global_dims)
 Attempt to compute the tensor dimensions of the local portion of the matrix, given the global tensor dimensions. More...
 
template<typename MatrixOutT , typename MatrixInT >
MatrixOutT & SafeMatrixCast (MatrixInT &in)
 
template<typename TDT >
void do_tensor_copy_between_grids (const BaseDistMat &src, El::AbstractDistMatrix< TDT > &tgt)
 Copy between two tensors on different process grids. More...
 
template<typename TDT , El::Dist ColDist, El::Dist RowDist, El::DistWrap Wrap, El::Device Device>
void do_tensor_copy_between_grids (const BaseDistMat &src, El::DistMatrix< TDT, ColDist, RowDist, Wrap, Device > &tgt)
 Copy between two tensors on different process grids. More...
 

Function Documentation

◆ do_tensor_copy_between_grids() [1/2]

template<typename TDT >
void lbann::utils::details::do_tensor_copy_between_grids ( const BaseDistMat src,
El::AbstractDistMatrix< TDT > &  tgt 
)

Copy between two tensors on different process grids.

Todo:
Do this more systematically and support all matrix classes

Definition at line 66 of file tensor_impl.hpp.

Here is the caller graph for this function:

◆ do_tensor_copy_between_grids() [2/2]

template<typename TDT , El::Dist ColDist, El::Dist RowDist, El::DistWrap Wrap, El::Device Device>
void lbann::utils::details::do_tensor_copy_between_grids ( const BaseDistMat src,
El::DistMatrix< TDT, ColDist, RowDist, Wrap, Device > &  tgt 
)

Copy between two tensors on different process grids.

Definition at line 129 of file tensor_impl.hpp.

◆ get_tensor_dims()

template<typename MatrixT >
std::vector<size_t> lbann::utils::details::get_tensor_dims ( MatrixT const &  A)

Interpret the matrix as a tensor and return the tensor-ized dimensions.

Parameters
[in]AThe matrix.
Returns
The dimensions of the matrix interpreted as a tensor.

Definition at line 65 of file tensor.hpp.

Here is the caller graph for this function:

◆ localize_dims()

template<typename T >
std::vector<size_t> lbann::utils::details::localize_dims ( El::AbstractDistMatrix< T > const &  A,
std::vector< size_t > const &  global_dims 
)

Attempt to compute the tensor dimensions of the local portion of the matrix, given the global tensor dimensions.

This is only valid in two cases. Either the matrix must be column-distributed or it must logically represent a collection of 1D arrays.

Definition at line 78 of file tensor.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SafeMatrixCast()

template<typename MatrixOutT , typename MatrixInT >
MatrixOutT& lbann::utils::details::SafeMatrixCast ( MatrixInT &  in)

Definition at line 127 of file tensor.hpp.

Here is the call graph for this function: