Tensor.scalar constructor

Tensor.scalar(
  1. double value
)

Creates a scalar tensor (shape = 1).

Implementation

factory Tensor.scalar(double value) {
  return Tensor(Float32List.fromList([value]), [1]);
}