static*/
| 19 | namespace oneflow { |
| 20 | |
| 21 | /*static*/ Maybe<FlatShape> FlatShape::New(const Shape& shape) { |
| 22 | const auto& flat_shape = std::make_shared<FlatShape>(); |
| 23 | JUST(flat_shape->Init(shape)); |
| 24 | return flat_shape; |
| 25 | } |
| 26 | |
| 27 | Maybe<void> FlatShape::Init(const Shape& shape) { |
| 28 | CHECK_LE_OR_RETURN(shape.NumAxes(), SHAPE_MAX_AXIS_SIZE); |