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

Function IsViewApplicable

oneflow/core/framework/tensor_methods.cpp:42–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42bool IsViewApplicable(const std::shared_ptr<Tensor>& input) {
43 if (IsEnvViewDisabled()) { return false; }
44 // NOTE: only eager local tensor support view for now
45 // elem_cnt() >= 1 used to excluding 0 shape tensor
46 if (input->is_local() && !(LazyMode::is_enabled()) && input->shape()->elem_cnt() >= 1) {
47 return true;
48 }
49 return false;
50}
51
52static bool IsOverlappingMemorys(const std::vector<int64_t>& sizes,
53 const std::vector<int64_t>& strides) {

Callers 15

operator()Method · 0.85
operator()Method · 0.85
operator()Method · 0.85
operator()Method · 0.85
operator()Method · 0.85
operator()Method · 0.85
operator()Method · 0.85
operator()Method · 0.85
operator()Method · 0.85
operator()Method · 0.85
operator()Method · 0.85
operator()Method · 0.85

Calls 5

IsEnvViewDisabledFunction · 0.85
is_enabledFunction · 0.70
is_localMethod · 0.45
elem_cntMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected