下文中的dim_num_为维度个数,即有几维;dims_为具体的维度值信息。
默认构造一个shape,默认构造的shape实例中,dim_num_长度为0
Shape() : dim_num_(0), dims_{0} 通过dims_值构造shape,例如:Shape({8,3,224,224})表示创建一个Shape实例,有4个维度,每个维度的值分别是8,3,224,224
Shape(const std::initializer_list<int64_t> &args) : Shape()
拷贝构造,为了提升性能,dims_超过源Shape dim_num_的空间没有拷贝,可能有脏数据
Shape(const Shape &other)
拷贝赋值,为了提升性能,dims_超过源Shape dim_num_的空间没有拷贝,可能有脏数据
Shape &operator=(const Shape &other)