| 1494 | } |
| 1495 | |
| 1496 | PyTensor PyTensor::eye(int64_t n, const std::string& device, |
| 1497 | const std::string& dtype) { |
| 1498 | auto t = Tensor::eye(static_cast<size_t>(n), parse_device(device)); |
| 1499 | if (dtype != "float32") { |
| 1500 | t = t.to(parse_dtype(dtype)); |
| 1501 | } |
| 1502 | return PyTensor(std::move(t)); |
| 1503 | } |
| 1504 | |
| 1505 | PyTensor PyTensor::eye(int64_t m, int64_t n, const std::string& device, |
| 1506 | const std::string& dtype) { |