Package deepnetts.tensor
Class Tensor1D
java.lang.Object
deepnetts.tensor.TensorBase
deepnetts.tensor.Tensor1D
- All Implemented Interfaces:
Tensor
,Serializable
One dimensional tensor - a vector or an array.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
add
(float value, int idx) Adds specified value to an element at specified index position in tensor.clone()
copy()
final float
get
(int idx) Gets value from specified index position.static Tensor1D
of
(float[] values) final void
set
(float val, int idx) Sets value at specified index position.Methods inherited from class deepnetts.tensor.TensorBase
add, add, addInto, apply, apply, copyFrom, copyFrom, copyFromGPU, copyToGPU, createAcceleratorBridge, div, div, div, equals, equals, fill, getAcceleratorBridge, getOrCreateAccBridge, getValues, hashCode, mean, multiply, multiply, multiplyElementWise, numDimensions, numElements, randomize, replace, setValues, setValuesFromString, setValuesFromStringTransposed, shape, sqr, sqrt, std, sub, sub, subInplace, subInto, sum, sumAbs, sumSqr, toString, valuesAsString
-
Constructor Details
-
Tensor1D
public Tensor1D(int size) -
Tensor1D
public Tensor1D(float... values) Creates a single row tensor with specified values.- Parameters:
values
- values of column tensor
-
Tensor1D
-
-
Method Details
-
get
public final float get(int idx) Gets value from specified index position.- Parameters:
idx
- position in tensor- Returns:
- value at specified position
-
set
public final void set(float val, int idx) Sets value at specified index position.- Parameters:
val
-idx
-
-
add
public final void add(float value, int idx) Adds specified value to an element at specified index position in tensor.- Parameters:
value
- value to addidx
- element index
-
copy
- Overrides:
copy
in classTensorBase
-
clone
- Overrides:
clone
in classTensorBase
-
of
-