TensorLabel constructor

TensorLabel(
  1. Map<int, List<String>> axisLabels,
  2. TensorBuffer tensorBuffer
)

Creates a TensorLabel object which is able to label on the axes of multi-dimensional tensors.

axisLabels is A map, whose key is axis id (starting from 0) and value is corresponding labels. Note: The size of labels should be same with the size of the tensor on that axis.

tensorBuffer to be labeled

Throws ArgumentError.notNull if axisLabels or tensorBuffer is null, or any value in axisLabels is null.

Throws ArgumentError if any key in axisLabels is out of range (compared to the shape of tensorBuffer, or any value (labels) has different size with the tensorBuffer on the given dimension.

Implementation

factory TensorLabel(
    Map<int, List<String>> axisLabels, TensorBuffer tensorBuffer) {
  return TensorLabel.fromMap(axisLabels, tensorBuffer);
}