MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / apply_on_physical_tensor

Function apply_on_physical_tensor

imperative/src/impl/ops/utility.cpp:33–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31namespace borrow {
32
33SmallVector<TensorPtr> apply_on_physical_tensor(
34 const OpDef& def, const SmallVector<TensorPtr>& inputs,
35 SmallVector<LogicalTensorDesc>& output_descs, const bool& validated) {
36 auto& op = def.cast_final_safe<Borrow>();
37 SmallVector<TensorPtr> outputs;
38 outputs.reserve(inputs.size());
39 for (auto& i : inputs) {
40 outputs.push_back(Tensor::make(
41 i->blob()->borrow_to(op.comp_node), i->layout(), i->offset()));
42 }
43 return outputs;
44}
45
46SmallVector<VarNode::LayoutConstraintCallback> get_input_layout_constraint(
47 const OpDef& def, const SmallVector<TensorPtr>& inputs) {

Callers

nothing calls this directly

Calls 15

device_wait_eventFunction · 0.85
TensorShapeClass · 0.85
borrow_toMethod · 0.80
blobMethod · 0.80
get_ready_eventMethod · 0.80
resizeMethod · 0.80
try_get_valueMethod · 0.80
backMethod · 0.80
shared_from_thisMethod · 0.80
makeFunction · 0.70
reserveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected