Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
Constructs an object of class Shape.
In the following, dim_num_ indicates the number of dimensions, and dims_ indicates the specific shape.
Constructs a shape by default. In the default shape instance, dim_num_ is 0.
- Shape() : dim_num_(0), dims_{0}
Constructs a shape using the dims_ value. For example, Shape({8,3,224,224}) indicates that a Shape instance is created with four dimensions, and the values of each dimension are 8, 3, 224, and 224.
- Shape(const std::initializer_list<int64_t> &args) : Shape()
Serves as a copy constructor. To improve performance, the space where dims_ exceeds the source shape dim_num_ is not copied. Dirty data may exist.
- Shape(const Shape &other)
Serves as a copy assignment operator. To improve performance, the space where dims_ exceeds the source shape dim_num_ is not copied. Dirty data may exist.
- Shape &operator=(const Shape &other)
| Parameter | Input/Output | Description |
|---|---|---|
| args | Input | All dimension values of the shape. |
| other | Input | Source shape object. |
Generated initialized Shape object.
None
- Shape shape({3, 256, 256}); // The first three dimensions of dims_ with dim_num_= 3 are 3, 256, and 256.