TODO: using this for apply_on_physical_tensor
| 54 | |
| 55 | // TODO: using this for apply_on_physical_tensor |
| 56 | bool memory_forward_success(const OpDef& def, SmallVector<TensorPtr> inputs) { |
| 57 | auto&& reduce = static_cast<const Reduce&>(def); |
| 58 | if (reduce.mode != Reduce::Mode::SUM_SQR && inputs.size() == 2) { |
| 59 | auto shape_tensor = inputs[1]->get_value(); |
| 60 | TensorShape shape; |
| 61 | cg::copy_tensor_value_to_shape(shape, shape_tensor.proxy_to_default_cpu()); |
| 62 | if (shape.eq_shape(inputs[0]->shape())) { |
| 63 | return true; |
| 64 | } |
| 65 | } |
| 66 | return false; |
| 67 | } |
| 68 | |
| 69 | SmallVector<TensorPtr> apply_on_physical_tensor( |
| 70 | const OpDef& def, const SmallVector<TensorPtr>& inputs, |
no test coverage detected