Functions | |
bool | AreSameShape (const std::vector< Dim > &, const std::vector< Dim > &) |
bool | AreSameShape (const std::vector< size_t > &, const std::vector< Dim > &) |
bool | AreSameShape (const std::vector< size_t > &, const std::vector< size_t > &) |
template<typename T > | |
T * | BroadcastConvBias (const T *data, const size_t channel, const std::vector< size_t > &targetShape) |
template<typename T , class ConstContT = std::span<const T>, class ContT = std::span<T>> | |
void | BroadcastTensor (ConstContT data, const std::vector< size_t > &shape, const std::vector< size_t > &targetShape, ContT broadcastedData) |
std::string | Clean_name (std::string input_tensor_name) |
template<typename Dtype > | |
void | col2im (const Dtype *data_col, const int channels, const int height, const int width, const int kernel_h, const int kernel_w, const int pad_h, const int pad_w, const int stride_h, const int stride_w, const int dilation_h, const int dilation_w, Dtype *data_im) |
std::vector< Dim > | ComputeStrideFromShape (const std::vector< Dim > &shape) |
std::vector< size_t > | ComputeStrideFromShape (const std::vector< size_t > &shape) |
compute stride of a tensor given its shape (assume layout is row-major) | |
template<typename T > | |
T * | CreateBroadcastTensor (const T *data, const std::vector< size_t > &shape, const std::vector< size_t > &targetShape, size_t targetLength) |
template<class T > | |
void | FillOutput (T const *arr, std::vector< T > &out, std::size_t n) |
template<typename T > | |
void | Im2col (const T *data_im, const int channels, const int height, const int width, const int kernel_h, const int kernel_w, const int pad_h, const int pad_w, const int stride_h, const int stride_w, const int dilation_h, const int dilation_w, T *data_col) |
im2col : efficient function to re-arrange input data of convolution to a matrix that can be used by BLAS Use trick to loop on each element of filtered region first and follow input data layout By doing this reads and writes are of consecutive data in memory and one gains in efficiency The resulting matrix will be already transposed and can be used directly in BLAS since output will be a matrix : (channels*kernel_h*kernel_w , output_h*output_w) Example: with an input matrix a1 a2 a3 b1 b2 b3 and a 2x2 kernel (k1,k2,k3,k4) and padding 1 : c1 c2 c3 outpout will be a matrix (4 x 16) the routine will follow output order : | |
template<typename T > | |
void | Im2col_3d (const T *data_im, const int channels, const int depth, const int height, const int width, const int kernel_d, const int kernel_h, const int kernel_w, const int pad_d, const int pad_h, const int pad_w, const int stride_d, const int stride_h, const int stride_w, const int dilation_d, const int dilation_h, const int dilation_w, T *data_col) |
3d implementation | |
bool | is_a_ge_zero_and_a_lt_b (int a, int b) |
function to check if a >> 0 and a < MAX using a single comparison / use trick casting to unsigned values so it becomes a single comparison | |
std::pair< int, std::vector< Dim > > | MultidirectionalBroadcastShape (std::vector< Dim > &, std::vector< Dim > &) |
std::pair< int, std::vector< size_t > > | MultidirectionalBroadcastShape (std::vector< size_t > &, std::vector< size_t > &) |
std::vector< size_t > | MultidirectionalBroadcastShape (std::vector< std::vector< size_t > >) |
template<typename T > | |
T * | UnidirectionalBroadcast (const T *data, const std::vector< size_t > &shape, const std::vector< size_t > &targetShape) |
template<typename T > | |
void | UnidirectionalBroadcast (const T *data, const std::vector< size_t > &shape, const std::vector< size_t > &targetShape, std::span< T > broadcastedData) |
std::vector< size_t > | UnidirectionalBroadcastShape (std::vector< size_t > &, std::vector< size_t > &) |
bool TMVA::Experimental::SOFIE::UTILITY::AreSameShape | ( | const std::vector< Dim > & | shapeA, |
const std::vector< Dim > & | shapeB ) |
Definition at line 224 of file SOFIE_common.cxx.
bool TMVA::Experimental::SOFIE::UTILITY::AreSameShape | ( | const std::vector< size_t > & | shapeA, |
const std::vector< Dim > & | shapeB ) |
Definition at line 212 of file SOFIE_common.cxx.
bool TMVA::Experimental::SOFIE::UTILITY::AreSameShape | ( | const std::vector< size_t > & | shapeA, |
const std::vector< size_t > & | shapeB ) |
Definition at line 201 of file SOFIE_common.cxx.
T * TMVA::Experimental::SOFIE::UTILITY::BroadcastConvBias | ( | const T * | data, |
const size_t | channel, | ||
const std::vector< size_t > & | targetShape ) |
Definition at line 361 of file SOFIE_common.hxx.
void TMVA::Experimental::SOFIE::UTILITY::BroadcastTensor | ( | ConstContT | data, |
const std::vector< size_t > & | shape, | ||
const std::vector< size_t > & | targetShape, | ||
ContT | broadcastedData ) |
Definition at line 403 of file SOFIE_common.hxx.
std::string TMVA::Experimental::SOFIE::UTILITY::Clean_name | ( | std::string | input_tensor_name | ) |
Definition at line 510 of file SOFIE_common.cxx.
void TMVA::Experimental::SOFIE::UTILITY::col2im | ( | const Dtype * | data_col, |
const int | channels, | ||
const int | height, | ||
const int | width, | ||
const int | kernel_h, | ||
const int | kernel_w, | ||
const int | pad_h, | ||
const int | pad_w, | ||
const int | stride_h, | ||
const int | stride_w, | ||
const int | dilation_h, | ||
const int | dilation_w, | ||
Dtype * | data_im ) |
Definition at line 630 of file SOFIE_common.hxx.
std::vector< Dim > TMVA::Experimental::SOFIE::UTILITY::ComputeStrideFromShape | ( | const std::vector< Dim > & | shape | ) |
Definition at line 528 of file SOFIE_common.cxx.
std::vector< size_t > TMVA::Experimental::SOFIE::UTILITY::ComputeStrideFromShape | ( | const std::vector< size_t > & | shape | ) |
compute stride of a tensor given its shape (assume layout is row-major)
Definition at line 518 of file SOFIE_common.cxx.
T * TMVA::Experimental::SOFIE::UTILITY::CreateBroadcastTensor | ( | const T * | data, |
const std::vector< size_t > & | shape, | ||
const std::vector< size_t > & | targetShape, | ||
size_t | targetLength ) |
Definition at line 469 of file SOFIE_common.hxx.
void TMVA::Experimental::SOFIE::UTILITY::FillOutput | ( | T const * | arr, |
std::vector< T > & | out, | ||
std::size_t | n ) |
Definition at line 678 of file SOFIE_common.hxx.
void TMVA::Experimental::SOFIE::UTILITY::Im2col | ( | const T * | data_im, |
const int | channels, | ||
const int | height, | ||
const int | width, | ||
const int | kernel_h, | ||
const int | kernel_w, | ||
const int | pad_h, | ||
const int | pad_w, | ||
const int | stride_h, | ||
const int | stride_w, | ||
const int | dilation_h, | ||
const int | dilation_w, | ||
T * | data_col ) |
im2col : efficient function to re-arrange input data of convolution to a matrix that can be used by BLAS Use trick to loop on each element of filtered region first and follow input data layout By doing this reads and writes are of consecutive data in memory and one gains in efficiency The resulting matrix will be already transposed and can be used directly in BLAS since output will be a matrix : (channels*kernel_h*kernel_w , output_h*output_w) Example: with an input matrix a1 a2 a3 b1 b2 b3 and a 2x2 kernel (k1,k2,k3,k4) and padding 1 : c1 c2 c3 outpout will be a matrix (4 x 16) the routine will follow output order :
-> ( 0 0 0 0 0 a1 a2 a3 0 b1 b2 b3 0 c1 c2 c3 ) all elements for k1 ( 0 0 0 0 a1 a2 a3 0 b1 b2 b3 0 c1 c2 c3 0 ) for k2 ( 0 a1 a2 a3 0 b1 b2 b3 0 c1 c2 c3 0 0 0 0 ) for k3 ( a1 a2 a3 0 b1 b2 b3 0 c1 c2 c3 0 0 0 0 0 ) for k4
Definition at line 540 of file SOFIE_common.hxx.
void TMVA::Experimental::SOFIE::UTILITY::Im2col_3d | ( | const T * | data_im, |
const int | channels, | ||
const int | depth, | ||
const int | height, | ||
const int | width, | ||
const int | kernel_d, | ||
const int | kernel_h, | ||
const int | kernel_w, | ||
const int | pad_d, | ||
const int | pad_h, | ||
const int | pad_w, | ||
const int | stride_d, | ||
const int | stride_h, | ||
const int | stride_w, | ||
const int | dilation_d, | ||
const int | dilation_h, | ||
const int | dilation_w, | ||
T * | data_col ) |
3d implementation
Definition at line 576 of file SOFIE_common.hxx.
function to check if a >> 0 and a < MAX using a single comparison / use trick casting to unsigned values so it becomes a single comparison
Definition at line 515 of file SOFIE_common.hxx.
std::pair< int, std::vector< Dim > > TMVA::Experimental::SOFIE::UTILITY::MultidirectionalBroadcastShape | ( | std::vector< Dim > & | shapeA, |
std::vector< Dim > & | shapeB ) |
Definition at line 432 of file SOFIE_common.cxx.
std::pair< int, std::vector< size_t > > TMVA::Experimental::SOFIE::UTILITY::MultidirectionalBroadcastShape | ( | std::vector< size_t > & | shapeA, |
std::vector< size_t > & | shapeB ) |
Definition at line 368 of file SOFIE_common.cxx.
std::vector< size_t > TMVA::Experimental::SOFIE::UTILITY::MultidirectionalBroadcastShape | ( | std::vector< std::vector< size_t > > | shape | ) |
Definition at line 236 of file SOFIE_common.cxx.
T * TMVA::Experimental::SOFIE::UTILITY::UnidirectionalBroadcast | ( | const T * | data, |
const std::vector< size_t > & | shape, | ||
const std::vector< size_t > & | targetShape ) |
Definition at line 481 of file SOFIE_common.hxx.
void TMVA::Experimental::SOFIE::UTILITY::UnidirectionalBroadcast | ( | const T * | data, |
const std::vector< size_t > & | shape, | ||
const std::vector< size_t > & | targetShape, | ||
std::span< T > | broadcastedData ) |
Definition at line 495 of file SOFIE_common.hxx.
std::vector< size_t > TMVA::Experimental::SOFIE::UTILITY::UnidirectionalBroadcastShape | ( | std::vector< size_t > & | shapeA, |
std::vector< size_t > & | shapeB ) |
Definition at line 416 of file SOFIE_common.cxx.