Converts the matrix values to int32 data type. If the matrix already uses int data type, the original matrix will be returned. Returns ------- DiagMatrix The matrix with int values Examples -------- >>> indices = torch.tensor([[1
(self)
| 386 | return self.to(dtype=torch.double) |
| 387 | |
| 388 | def int(self): |
| 389 | """Converts the matrix values to int32 data type. If the matrix already |
| 390 | uses int data type, the original matrix will be returned. |
| 391 | |
| 392 | Returns |
| 393 | ------- |
| 394 | DiagMatrix |
| 395 | The matrix with int values |
| 396 | |
| 397 | Examples |
| 398 | -------- |
| 399 | |
| 400 | >>> indices = torch.tensor([[1, 1, 2], [1, 2, 0]]) |
| 401 | >>> A = dglsp.spmatrix(indices, shape=(3, 4)) |
| 402 | >>> A.int() |
| 403 | SparseMatrix(indices=tensor([[1, 1, 2], |
| 404 | [1, 2, 0]]), |
| 405 | values=tensor([1, 1, 1], dtype=torch.int32), |
| 406 | shape=(3, 4), nnz=3) |
| 407 | """ |
| 408 | return self.to(dtype=torch.int) |
| 409 | |
| 410 | def long(self): |
| 411 | """Converts the matrix values to long data type. If the matrix already |
no test coverage detected