FlatTensor constructor

FlatTensor({
  1. Iterable<Int64>? shape,
  2. FlatTensorDataInt8? int8Tensor,
  3. FlatTensorDataUInt8? uint8Tensor,
  4. FlatTensorDataInt16? int16Tensor,
  5. FlatTensorDataUInt16? uint16Tensor,
  6. FlatTensorDataInt32? int32Tensor,
  7. FlatTensorDataUInt32? uint32Tensor,
  8. FlatTensorDataInt64? int64Tensor,
  9. FlatTensorDataUInt64? uint64Tensor,
  10. FlatTensorDataFloat? floatTensor,
  11. FlatTensorDataDouble? doubleTensor,
})

Implementation

factory FlatTensor({
  $core.Iterable<$fixnum.Int64>? shape,
  FlatTensorDataInt8? int8Tensor,
  FlatTensorDataUInt8? uint8Tensor,
  FlatTensorDataInt16? int16Tensor,
  FlatTensorDataUInt16? uint16Tensor,
  FlatTensorDataInt32? int32Tensor,
  FlatTensorDataUInt32? uint32Tensor,
  FlatTensorDataInt64? int64Tensor,
  FlatTensorDataUInt64? uint64Tensor,
  FlatTensorDataFloat? floatTensor,
  FlatTensorDataDouble? doubleTensor,
}) {
  final $result = create();
  if (shape != null) {
    $result.shape.addAll(shape);
  }
  if (int8Tensor != null) {
    $result.int8Tensor = int8Tensor;
  }
  if (uint8Tensor != null) {
    $result.uint8Tensor = uint8Tensor;
  }
  if (int16Tensor != null) {
    $result.int16Tensor = int16Tensor;
  }
  if (uint16Tensor != null) {
    $result.uint16Tensor = uint16Tensor;
  }
  if (int32Tensor != null) {
    $result.int32Tensor = int32Tensor;
  }
  if (uint32Tensor != null) {
    $result.uint32Tensor = uint32Tensor;
  }
  if (int64Tensor != null) {
    $result.int64Tensor = int64Tensor;
  }
  if (uint64Tensor != null) {
    $result.uint64Tensor = uint64Tensor;
  }
  if (floatTensor != null) {
    $result.floatTensor = floatTensor;
  }
  if (doubleTensor != null) {
    $result.doubleTensor = doubleTensor;
  }
  return $result;
}