Scalar Tensor
| 172 | |
| 173 | // Scalar Tensor |
| 174 | bool PyScalarTensorCheck(PyObject* obj) { |
| 175 | if (!LazyMode::is_enabled() && PyTensor_Check(obj)) { |
| 176 | const auto& tensor = PyTensor_Unpack(obj); |
| 177 | return tensor->shape()->size() == 0 |
| 178 | && IsTriviallyCopyableDataType(tensor->dtype()->data_type()); |
| 179 | } |
| 180 | return false; |
| 181 | } |
| 182 | |
| 183 | Scalar PyUnpackScalarTensor(PyObject* obj) { |
| 184 | if (PyBoolScalarTensorCheck(obj)) { |
no test coverage detected