BlackCat_Tensors
A GPU-supported autograd and linear algebra library, designed for neural network construction
Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
bc::Shape< N > Struct Template Reference

#include <shape.h>

Inheritance diagram for bc::Shape< N >:
Inheritance graph
[legend]

Public Types

using size_t = bc::size_t
 
using value_type = size_t
 

Public Member Functions

BCINLINE Shape ()
 
template<class... Integers, class = std::enable_if_t< bc::traits::sequence_of_v<size_t, Integers...> && (sizeof...(Integers) == N)>>
BCINLINE Shape (Integers... ints)
 
template<int X, class = std::enable_if_t<(X > N>
BCINLINE Shape (const Shape< X > &shape)
 
BCINLINE Shape (Dim< N > new_shape, const Shape< N > &parent_shape)
 
BCINLINE Shape (const Shape< N > &new_shape, const Shape< N > &parent_shape)
 
BCINLINE Shape (Dim< N > dims)
 
BCINLINE const auto & inner_shape () const
 
BCINLINE const auto & outer_shape () const
 
BCINLINE size_t operator[] (size_t i) const
 
BCINLINE size_t size () const
 
BCINLINE size_t rows () const
 
BCINLINE size_t cols () const
 
BCINLINE size_t dim (int i) const
 
BCINLINE size_t outer_dim () const
 
BCINLINE size_t leading_dim (int i=N-1) const
 
BCINLINE bool operator== (const Shape &other) const
 
BCINLINE size_t coefficientwise_dims_to_index (size_t index) const
 
template<class... Integers, class = std::enable_if_t< bc::traits::sequence_of_v<size_t, Integers...> && (sizeof...(Integers) >= N>
BCINLINE size_t dims_to_index (Integers... ints) const
 
template<int D, class = std::enable_if_t<(D>=N>
BCINLINE size_t dims_to_index (const Dim< D > &var) const
 

Static Public Attributes

static constexpr int tensor_dim = N
 

Friends

template<int >
struct Shape
 

Member Typedef Documentation

◆ size_t

template<int N>
using bc::Shape< N >::size_t = bc::size_t

◆ value_type

template<int N>
using bc::Shape< N >::value_type = size_t

Constructor & Destructor Documentation

◆ Shape() [1/6]

template<int N>
BCINLINE bc::Shape< N >::Shape ( )
inline

◆ Shape() [2/6]

template<int N>
template<class... Integers, class = std::enable_if_t< bc::traits::sequence_of_v<size_t, Integers...> && (sizeof...(Integers) == N)>>
BCINLINE bc::Shape< N >::Shape ( Integers...  ints)
inline

◆ Shape() [3/6]

template<int N>
template<int X, class = std::enable_if_t<(X > N>
BCINLINE bc::Shape< N >::Shape ( const Shape< X > &  shape)
inline

◆ Shape() [4/6]

template<int N>
BCINLINE bc::Shape< N >::Shape ( Dim< N >  new_shape,
const Shape< N > &  parent_shape 
)
inline

◆ Shape() [5/6]

template<int N>
BCINLINE bc::Shape< N >::Shape ( const Shape< N > &  new_shape,
const Shape< N > &  parent_shape 
)
inline

◆ Shape() [6/6]

template<int N>
BCINLINE bc::Shape< N >::Shape ( Dim< N >  dims)
inline

Member Function Documentation

◆ coefficientwise_dims_to_index()

template<int N>
BCINLINE size_t bc::Shape< N >::coefficientwise_dims_to_index ( size_t  index) const
inline

◆ cols()

template<int N>
BCINLINE size_t bc::Shape< N >::cols ( ) const
inline

◆ dim()

template<int N>
BCINLINE size_t bc::Shape< N >::dim ( int  i) const
inline

◆ dims_to_index() [1/2]

template<int N>
template<class... Integers, class = std::enable_if_t< bc::traits::sequence_of_v<size_t, Integers...> && (sizeof...(Integers) >= N>
BCINLINE size_t bc::Shape< N >::dims_to_index ( Integers...  ints) const
inline

◆ dims_to_index() [2/2]

template<int N>
template<int D, class = std::enable_if_t<(D>=N>
BCINLINE size_t bc::Shape< N >::dims_to_index ( const Dim< D > &  var) const
inline

◆ inner_shape()

template<int N>
BCINLINE const auto& bc::Shape< N >::inner_shape ( ) const
inline

◆ leading_dim()

template<int N>
BCINLINE size_t bc::Shape< N >::leading_dim ( int  i = N-1) const
inline

◆ operator==()

template<int N>
BCINLINE bool bc::Shape< N >::operator== ( const Shape< N > &  other) const
inline

◆ operator[]()

template<int N>
BCINLINE size_t bc::Shape< N >::operator[] ( size_t  i) const
inline

◆ outer_dim()

template<int N>
BCINLINE size_t bc::Shape< N >::outer_dim ( ) const
inline

◆ outer_shape()

template<int N>
BCINLINE const auto& bc::Shape< N >::outer_shape ( ) const
inline

◆ rows()

template<int N>
BCINLINE size_t bc::Shape< N >::rows ( ) const
inline

◆ size()

template<int N>
BCINLINE size_t bc::Shape< N >::size ( ) const
inline

Friends And Related Function Documentation

◆ Shape

template<int N>
template<int >
friend struct Shape
friend

Member Data Documentation

◆ tensor_dim

template<int N>
constexpr int bc::Shape< N >::tensor_dim = N
static

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