eye static method
Creates a 2D identity matrix.
Equivalent to torch.eye() in PyTorch.
final tensor = TensorBuffer.eye(3); // 3x3 identity matrix
final rect = TensorBuffer.eye(2, m: 4); // 2x4 matrix with 1s on diagonal
Implementation
static TensorBuffer eye(int n, {int? m, DType dtype = DType.float32}) =>
_eyeImpl(n, m: m, dtype: dtype);