Methods
# inner arrayFromTensor(tensor) → {Array}
Returns the tensor data as a nested array. The transfer of data is done synchronously.
Parameters:
Name | Type | Description |
---|---|---|
tensor |
Tensor
|
The tensor to convert. |
tensor.arraySync().
Array
# inner tensorShape(tensor) → {Array}
Gets the shape of a TensorFlow.js tensor.
Parameters:
Name | Type | Description |
---|---|---|
tensor |
Tensor
|
The tensor to find shape. |
tensor.shape.
Array
# inner valueFromTensorShape(tensor, index) → {Number|Array.<Number>}
Gets the value at a specific index of a TensorFlow.js tensor's shape.
Parameters:
Name | Type | Description |
---|---|---|
tensor |
Tensor
|
The tensor to find shape. |
index |
Number
|
The index |
tensor.shape[index].
Number
|
Array.<Number>