| 420 | } |
| 421 | |
| 422 | SymbolVar cg::var_from_tensor_shape( |
| 423 | ComputingGraph& graph, const OperatorNodeConfig& config, const char* opr_name, |
| 424 | const TensorShape& shape) { |
| 425 | auto cn = config.get_single_comp_node(); |
| 426 | mgb_throw_if( |
| 427 | !cn.valid(), GraphError, "must specify comp node in %s config", opr_name); |
| 428 | DeviceTensorND dv; |
| 429 | copy_shape_to_tensor_value(dv, shape); |
| 430 | HostTensorND hv{cn}; |
| 431 | hv.copy_from(dv); |
| 432 | return opr::ImmutableTensor::make(graph, hv); |
| 433 | } |
| 434 | |
| 435 | /* =================== DepOprIter =================== */ |
| 436 | void cg::DepOprIter::push_stack(OperatorNodeBase* opr) { |
nothing calls this directly
no test coverage detected