Closed forFudan closed 3 months ago
Implement the __repr__ method that computes the "official" string representation of NDArray. An example is:
__repr__
fn main() raises: var A = NDArray[DType.int8](List[Scalar[DType.int8]](14,97,-59,-4,112,), shape=List[Int](5,)) print(repr(A))
It prints what can be used to construct the array itself:
NDArray[DType.int8](List[Scalar[DType.int8]](14,97,-59,-4,112,), shape=List[Int](5,))
Implement the
__repr__
method that computes the "official" string representation of NDArray. An example is:It prints what can be used to construct the array itself: