| 1217 | |
| 1218 | template <class Opr> |
| 1219 | void run_modify_multi_axis_vec_empty_shape( |
| 1220 | const TensorShape& ishp, const TensorShape& vshp, const TensorShape& idx0, |
| 1221 | const TensorShape& idx1) { |
| 1222 | mgb_assert(ishp.ndim >= 4); |
| 1223 | mgb_assert(vshp.is_empty() && (idx0.is_empty() || idx1.is_empty())); |
| 1224 | using AI = opr::indexing::AxisIndexer; |
| 1225 | auto graph = ComputingGraph::make(); |
| 1226 | HostTensorGenerator<> gen; |
| 1227 | HostTensorGenerator<dtype::Int32> gen_idx; |
| 1228 | auto host_x = gen(ishp), host_v = gen(vshp); |
| 1229 | auto x = opr::Host2DeviceCopy::make(*graph, host_x), |
| 1230 | v = opr::Host2DeviceCopy::make(*graph, host_v), |
| 1231 | idx_dynamic_shape = opr::MarkDynamicVar::make( |
| 1232 | opr::ImmutableTensor::make(*graph, *gen_idx(idx0))), |
| 1233 | idx_static_shape = opr::ImmutableTensor::make(*graph, *gen_idx(idx1)), |
| 1234 | y = Opr::make( |
| 1235 | x, v, |
| 1236 | {AI::make_interval(-1, None, None, x.make_scalar(2)), |
| 1237 | AI::make_index(1, idx_dynamic_shape), |
| 1238 | AI::make_index(2, idx_static_shape)}); |
| 1239 | HostTensorND host_y; |
| 1240 | auto func = graph->compile({make_callback_copy(y, host_y)}); |
| 1241 | func->execute(); |
| 1242 | MGB_ASSERT_TENSOR_EQ(*host_x, host_y); |
| 1243 | } |
| 1244 | |
| 1245 | } // namespace |
| 1246 |
nothing calls this directly
no test coverage detected