getXY method
Gets element value.
Implementation
T getXY(int x, int y) {
final tensorShape = this.tensorShape;
if (tensorShape.numberOfDimensions != 2) {
throw ArgumentError('Shape of the tensor is: $tensorShape');
}
if (x < 0 || x >= tensorShape.x) {
throw ArgumentError.value(x, 'x');
}
if (y < 0 || y >= tensorShape.y) {
throw ArgumentError.value(y, 'y');
}
return elements[x + tensorShape.x * y];
}