tfjs_sys

Function buffer

Source
pub fn buffer(
    shape: &Array,
    dtype: Option<&str>,
    values: Option<&Float32Array>,
) -> TensorBuffer
Expand description

Creates an empty TensorBuffer with the specified shape and dtype.

The values are stored in CPU as TypedArray. Fill the buffer using buffer.set(), or by modifying directly buffer.values.

When done, call buffer.toTensor() to get an immutable Tensor with those values.