# new Tensor(dim, array)
Parameters:
Name | Type | Description |
---|---|---|
dim |
Array.<number>
|
The dimension of the Tensor |
array |
Array.<any>
|
The actual managed array element |
- Implements:
Members
Methods
# get(indices) → {Array.<any>|number}
Get a certain index of the array.
Parameters:
Name | Type | Description |
---|---|---|
indices |
Array.<number>
|
The Tensor index to return |
The digit or sub array
Array.<any>
|
number
# isEqual(comp) → {boolean}
is Tensor equal
Parameters:
Name | Type | Description |
---|---|---|
comp |
Tensor
|
- Implements:
Whether it is equal
boolean
# set(indices, value) → {void}
Set the value at a certain index
Parameters:
Name | Type | Description |
---|---|---|
indices |
Array.<number>
|
The indices of the position |
value |
Array.<any>
|
number
|
The new value of the index |
void
# static Ones(dims) → {Tensor}
Static function to initialize an Tensor filled with Ones
Parameters:
Name | Type | Description |
---|---|---|
dims |
Array.<number>
|
The dimensions of the Tensor to initialize |
a filled Tensor
# static Random(dims, randomSeednullable) → {Tensor}
Static function to initialize an Tensor filled with random number in the range of [0<=x<=1]
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
dims |
Array.<number>
|
The dimensions of the Tensor to initialize |
|
randomSeed |
number
|
<nullable> |
random seed to used for random number generator |
a filled Tensor
# static Zeros(dims) → {Tensor}
Static function to initialize an Tensor filled with Zeros
Parameters:
Name | Type | Description |
---|---|---|
dims |
Array.<number>
|
The dimensions of the Tensor to initialize |
a filled Tensor
# static fromJSONObject(jsonTensor) → {Tensor}
Convert JSONTensor to actual Tensor
Parameters:
Name | Type | Description |
---|---|---|
jsonTensor |
JSONTensor
|
json tensor to convert |
- the converted Tensor