MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / Init

Method Init

oneflow/core/common/flat_shape.cpp:27–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27Maybe<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
34Maybe<void> FlatShape::Check(const Shape& shape) const {
35 CHECK_EQ_OR_RETURN(this->dim_size(), shape.NumAxes())

Callers 1

NewMethod · 0.45

Calls 3

NumAxesMethod · 0.45
AddMethod · 0.45
AtMethod · 0.45

Tested by

no test coverage detected