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

Method SharedDeviceTensorBase

src/opr/impl/io.cpp:269–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267/* ===================== SharedDeviceTensor related ===================== */
268
269intl::SharedDeviceTensorBase::SharedDeviceTensorBase(
270 ComputingGraph& graph, const std::shared_ptr<DeviceTensorND>& dev_data,
271 bool const_value, const OperatorNodeConfig& config)
272 : Super{&graph, config, "shared", {}},
273 m_dev_data{dev_data},
274 m_const_value(const_value) {
275 if (config.has_comp_node_set()) {
276 mgb_assert(config.get_single_comp_node() == dev_data->comp_node());
277 }
278 add_output(dev_data->dtype());
279 add_equivalence_component<ScalarHash<void*>>(dev_data.get());
280}
281
282const TensorShape& intl::SharedDeviceTensorBase::get_output_shape() {
283 return m_dev_data->shape();

Callers

nothing calls this directly

Calls 5

has_comp_node_setMethod · 0.80
get_single_comp_nodeMethod · 0.80
comp_nodeMethod · 0.45
dtypeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected