MCPcopy Index your code
hub / github.com/tensorflow/tfjs / cast

Method cast

tfjs-core/src/tensor.ts:496–499  ·  view source on GitHub ↗
(dtype: DataType)

Source from the content-addressed store, hash-verified

494 }
495
496 cast<T extends this>(dtype: DataType): T {
497 this.throwIfDisposed();
498 return opHandler.cast(this as T, dtype);
499 }
500 variable(trainable = true, name?: string, dtype?: DataType): Variable<R> {
501 this.throwIfDisposed();
502 return trackerFn().makeVariable(this, trainable, name, dtype) as

Callers

nothing calls this directly

Calls 2

throwIfDisposedMethod · 0.95
castMethod · 0.65

Tested by

no test coverage detected