toBuilder method

  1. @override
Float32TensorBuilder toBuilder({
  1. bool copy = true,
})
override

Constructs a new TensorBuilder that has this tensor.

If copy is false, this tensor is not copied to the tensor builder.

Implementation

@override
Float32TensorBuilder toBuilder({bool copy = true}) {
  final builder = Float32TensorBuilder();
  if (copy) {
    builder.tensorShape = tensorShape;
    builder.elements.setRange(0, length, elements);
  }
  return builder;
}