12 #ifndef EXATN_NUMERICS_TENSOR_SHAPE_HPP_
13 #define EXATN_NUMERICS_TENSOR_SHAPE_HPP_
15 #include "tensor_basic.hpp"
19 #include <type_traits>
20 #include <initializer_list>
48 void printItFile(std::ofstream & output_file)
const;
73 std::vector<DimExtent> extents_;
80 extents_(extents.size())
82 static_assert(std::is_integral<T>::value,
"FATAL(TensorShape::TensorShape): TensorShape extent type must be integral!");
85 for(
const auto & extent: extents){
86 if(extent < 0) std::cout <<
"ERROR(TensorShape::TensorShape): Negative dimension extent passed!" << std::endl;
91 for(
const auto & extent: extents) extents_[i++] = static_cast<DimExtent>(extent);
96 extents_(extents.size())
98 static_assert(std::is_integral<T>::value,
"FATAL(TensorShape::TensorShape): TensorShape extent type must be integral!");
101 for(
const auto & extent: extents){
102 if(extent < 0) std::cout <<
"ERROR(TensorShape::TensorShape): Negative dimension extent passed!" << std::endl;
107 for(
const auto & extent: extents) extents_[i++] = static_cast<DimExtent>(extent);
114 #endif //EXATN_NUMERICS_TENSOR_SHAPE_HPP_