Class Tensor1D
java.lang.Object
deepnetts.tensor.TensorBase
deepnetts.tensor.Tensor1D
- All Implemented Interfaces:
Tensor, Serializable
-
Field Summary
Fields inherited from class TensorBase
numDimensions, shape, values, vectorizationImpl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidadd(float value, int idx) Adds specified value to an element at specified index position in tensor.final Tensor1Dclone()copy()static Tensor1Dfinal floatget(int idx) Gets value from specified index position.static Tensor1Dof(float[] values) Create and return a 1D tensor of specified values.voidouterProduct(Tensor1D otherTensor, Tensor2D result) final voidset(float val, int idx) Sets value at specified index position.voidMethods inherited from class TensorBase
add, add, addInto, apply, apply, containsNaN, copyFrom, copyFrom, copyFromGPU, copyToGPU, createAcceleratorBridge, div, div, div, equals, equals, fill, getAcceleratorBridge, getOrCreateAccBridge, getValues, hashCode, mean, multiply, multiply, multiplyElementWise, numDimensions, numElements, randomize, replace, setShape, setValues, setValuesFromString, setValuesFromStringTransposed, shape, sqr, sqrt, std, sub, sub, sub, subInplace, sum, sumAbs, sumSqr, toString, toTsr, 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
-
add
-
copy
- Overrides:
copyin classTensorBase
-
clone
- Overrides:
clonein classTensorBase
-
of
Create and return a 1D tensor of specified values.- Parameters:
values-- Returns:
-
fromFile
- Throws:
IOException
-
toFile
- Throws:
IOException
-
outerProduct
-