35 #ifndef SHARK_CORE_SHAPE_H 36 #define SHARK_CORE_SHAPE_H 39 #include <initializer_list> 41 #include <boost/serialization/vector.hpp> 70 Shape(std::size_t
size): m_dims(1,size), m_numElements(size){}
71 Shape(std::initializer_list<std::size_t> dims): m_dims(dims){
73 for(
auto dim: m_dims){
89 return Shape({m_numElements});
92 template<
class Archive>
93 void serialize(Archive & archive,
unsigned int version){
95 archive & m_numElements;
98 std::vector<std::size_t> m_dims;
99 std::size_t m_numElements;
105 for(std::size_t i = 0; i != shape1.
size(); ++i){
106 if(shape1[i] != shape2[i]){
114 return ! (shape1 == shape2);
117 template<
class E,
class T>
118 std::basic_ostream<E, T> &operator << (std::basic_ostream<E, T> &os,
Shape const& shape) {
120 for(std::size_t i = 0; i != shape.size(); ++i){
122 if(i != shape.size() -1)