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

Function BasicView

oneflow/core/framework/tensor_methods.cpp:82–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82Maybe<Tensor> BasicView(const std::shared_ptr<Tensor>& input, const Shape& target_shape,
83 const int64_t storage_offset) {
84 /**
85 * This function provides basic view capabilities which
86 * accept input tensor with target shape, and return viewed tensor.
87 *
88 * The viewed tensor shared memory with input tensor, and both of
89 * them are memory contiguous, but has different shapes/strides.
90 */
91 Stride target_stride(target_shape);
92 return BasicView(input, target_shape, target_stride, storage_offset);
93}
94
95Maybe<Tensor> BasicView(const std::shared_ptr<Tensor>& input, const Shape& target_shape,
96 const Stride& target_stride, const int64_t storage_offset) {

Callers 11

ReshapeFunction · 0.85
SliceFunction · 0.85
UnsqueezeFunction · 0.85
SqueezeFunction · 0.85
ExpandFunction · 0.85
NarrowFunction · 0.85
AsStridedFunction · 0.85
TransposeFunction · 0.85
UnfoldTensorFunction · 0.85
DiagonalFunction · 0.85
RunViewOpFunction · 0.85

Calls 15

SymbolOfFunction · 0.85
set_input_of_view_opMethod · 0.80
is_enabledFunction · 0.70
LocalTensorMetaClass · 0.50
deviceMethod · 0.45
data_typeMethod · 0.45
dtypeMethod · 0.45
memory_formatMethod · 0.45
has_eager_blob_objectMethod · 0.45
eager_blob_objectMethod · 0.45
requires_gradMethod · 0.45
tensor_storageMethod · 0.45

Tested by

no test coverage detected