toObject method

dynamic toObject({
  1. DataType<T?>? type,
})

Returns an object representing this tensor.

Depending on its dimensionality this is a single value (rank = 0), a list of values (rank = 1), or a list of nested lists (rank > 1).

Implementation

dynamic toObject({DataType<T?>? type}) => layout.length == 0
    ? null
    : _toObject(this,
        type: type ?? this.type, axis: 0, offset: layout.offset);