| 39 | namespace { |
| 40 | |
| 41 | bool IsScalarTensor(const one::Tensor& tensor) { |
| 42 | const auto& shape = tensor.shape(); |
| 43 | return shape->elem_cnt() == 1; |
| 44 | } |
| 45 | |
| 46 | // Checks and sets default value for initial gradients based on out_grads |
| 47 | // If output is the tensor whose size is greater than 1, out_grad's shape must be same as output's. |
no test coverage detected