| 25 | } |
| 26 | |
| 27 | Maybe<void> FlatShape::Init(const Shape& shape) { |
| 28 | CHECK_LE_OR_RETURN(shape.NumAxes(), SHAPE_MAX_AXIS_SIZE); |
| 29 | this->clear_dim(); |
| 30 | for (int i = 0; i < shape.NumAxes(); ++i) { *this->mutable_dim()->Add() = shape.At(i); } |
| 31 | return Maybe<void>::Ok(); |
| 32 | } |
| 33 | |
| 34 | Maybe<void> FlatShape::Check(const Shape& shape) const { |
| 35 | CHECK_EQ_OR_RETURN(this->dim_size(), shape.NumAxes()) |