Id of the bucket holding the data for this tensor. Multiple arrays can point to the same bucket (e.g. when calling array.reshape()).
Readonly
dtypeThe data type for the array.
Readonly
idUnique id of this tensor.
Whether this tensor has been globally kept.
Optional
kerasThe keras mask that some keras layers attach to the tensor
Readonly
rankThe rank type for the array (see Rank
enum).
The id of the scope this tensor is being tracked in.
Readonly
shapeThe shape of the tensor.
Readonly
sizeNumber of elements in the tensor.
Readonly
stridesNumber of elements to skip in each dimension when indexing. See https://docs.scipy.org/doc/numpy/reference/generated/\ numpy.ndarray.strides.html
Optional
offset: Tensor1D | TensorLike | Tensor<R>Optional
scale: Tensor1D | TensorLike | Tensor<R>Optional
varianceEpsilon: numberOptional
dataFormat: "NWC" | "NCW"Optional
dilation: numberOptional
dimRoundingMode: "floor" | "round" | "ceil"Optional
dataFormat: "NHWC" | "NCHW"Optional
dilations: number | [number, number]Optional
dimRoundingMode: "floor" | "round" | "ceil"Optional
dimRoundingMode: "floor" | "round" | "ceil"Copy the tensor's data to a new GPU resource. Comparing to the dataSync()
and data()
, this method prevents data from being downloaded to CPU.
For WebGL backend, the data will be stored on a densely packed texture. This means that the texture will use the RGBA channels to store value.
For WebGPU backend, the data will be stored on a buffer. There is no parameter, so can not use a user-defined size to create the buffer.
Optional
options: DataToGPUWebGLOptionFor WebGL backend, a GPUData contains the new texture and its information. { tensorRef: The tensor that is associated with this texture, texture: WebGLTexture, texShape: [number, number] // [height, width] }
For WebGPU backend, a GPUData contains the new buffer.
{
tensorRef: The tensor that is associated with this buffer,
buffer: GPUBuffer,
}
Remember to dispose the GPUData after it is used by
`res.tensorRef.dispose()`.
Optional
dataFormat: "NHWC" | "NCHW"Optional
dilations: number | [number, number]Optional
dimRoundingMode: "floor" | "round" | "ceil"Optional
diationRate: number | [number, number]Optional
strides: number | [number, number]Optional
dimRoundingMode: "floor" | "round" | "ceil"Optional
dilation: number | [number, number]Optional
dataFormat: "NHWC" | "NCHW"
A mutable
tf.Tensor
, useful for persisting state, e.g. for training.Doc