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

Method New

oneflow/core/common/flat_shape.cpp:21–25  ·  view source on GitHub ↗

static*/

Source from the content-addressed store, hash-verified

19namespace 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
27Maybe<void> FlatShape::Init(const Shape& shape) {
28 CHECK_LE_OR_RETURN(shape.NumAxes(), SHAPE_MAX_AXIS_SIZE);

Callers

nothing calls this directly

Calls 1

InitMethod · 0.45

Tested by

no test coverage detected