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

Method Check

oneflow/core/common/flat_shape.cpp:34–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34Maybe<void> FlatShape::Check(const Shape& shape) const {
35 CHECK_EQ_OR_RETURN(this->dim_size(), shape.NumAxes())
36 << Error::RuntimeError()
37 << "Expected same shape on each rank, but found at least two shapes, "
38 << JUST(ToShape())->ToString() << " and " << shape.ToString() << "!";
39 for (int i = 0; i < this->dim_size(); ++i) { CHECK_EQ_OR_RETURN(this->dim(i), shape.At(i)); }
40 return Maybe<void>::Ok();
41}
42
43Maybe<void> FlatShape::Check(const FlatShape& flat_shape) const {
44 CHECK_EQ_OR_RETURN(this->dim_size(), flat_shape.NumAxes())

Callers

nothing calls this directly

Calls 6

ToShapeFunction · 0.85
dimMethod · 0.80
NumAxesMethod · 0.45
ToStringMethod · 0.45
AtMethod · 0.45
ToShapeMethod · 0.45

Tested by

no test coverage detected