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

Method New

oneflow/core/framework/tensor_impl.cpp:199–206  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

197 cur_rank_phy_tensor_(cur_rank_phy_tensor) {}
198
199/* static */ Maybe<EagerGlobalTensorImpl> EagerGlobalTensorImpl::New(
200 Symbol<GlobalTensorMeta> global_tensor_meta, bool requires_grad, bool is_leaf) {
201 const auto& parallel_desc = global_tensor_meta->parallel_desc();
202 Optional<int64_t> parallel_id;
203 const auto& device = JUST(parallel_desc->GetTensorDevice4CurrentProcessCtx(&parallel_id));
204 return EagerGlobalTensorImpl::New(global_tensor_meta, device, parallel_id, requires_grad,
205 is_leaf);
206}
207
208namespace {
209

Callers

nothing calls this directly

Calls 15

SymbolOfFunction · 0.85
NewLocalDepObjectFunction · 0.85
GetFunction · 0.85
shape_ptrMethod · 0.80
NewFunction · 0.70
GetPhysicalShapeFunction · 0.70
LocalTensorMetaClass · 0.50
parallel_descMethod · 0.45
dtypeMethod · 0.45
memory_formatMethod · 0.45
nd_sbpMethod · 0.45

Tested by

no test coverage detected