Returns the underlying bytes of the tensor's data.
()
| 426 | |
| 427 | /** Returns the underlying bytes of the tensor's data. */ |
| 428 | async bytes(): Promise<Uint8Array[]|Uint8Array> { |
| 429 | this.throwIfDisposed(); |
| 430 | const data = await trackerFn().read(this.dataId); |
| 431 | if (this.dtype === 'string') { |
| 432 | return data as Uint8Array[]; |
| 433 | } else { |
| 434 | return new Uint8Array((data as TypedArray).buffer); |
| 435 | } |
| 436 | } |
| 437 | |
| 438 | /** |
| 439 | * Disposes `tf.Tensor` from memory. |
no test coverage detected