expand method

Tensor expand(
  1. List<int> newShape
)

Expand a size-1 dimension to the given size (broadcast).

Implementation

Tensor expand(List<int> newShape) {
  assert(newShape.length == ndim);
  final result = Tensor.zeros(newShape);
  _broadcastCopy(this, result);
  return result;
}