object Tensor extends Serializable
- Alphabetic
- By Inheritance
- Tensor
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
START_INDEX: Int
Start index in BigDL.
Start index in BigDL. We count from 1.
-
def
apply(matrix: DenseMatrix): Tensor[Double]
create a tensor with a given spark Densematrix.
create a tensor with a given spark Densematrix. The tensor will have the same size with the given spark Densematrix.
-
def
apply[T](matrix: DenseMatrix[T])(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
create a tensor with a given breeze matrix.
create a tensor with a given breeze matrix. The tensor will have the same size with the given breeze matrix.
- matrix
the given breeze matrix
-
def
apply(vector: DenseVector): Tensor[Double]
create a tensor with a given spark Densevector.
create a tensor with a given spark Densevector. The tensor will have the same size with the given spark Densevector.
- vector
the given spark Densevector
-
def
apply[T](vector: DenseVector[T])(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
create a tensor with a given breeze vector.
create a tensor with a given breeze vector. The tensor will have the same size with the given breeze vector.
- vector
the given breeze vector
-
def
apply[T](other: Tensor[T])(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
create a tensor with a given tensor.
create a tensor with a given tensor. The tensor will have same size with the given tensor.
- other
the given tensor
-
def
apply[T](storage: Storage[T], storageOffset: Int, size: Array[Int] = null, stride: Array[Int] = null)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Returns a tensor which uses the existing Storage storage, starting at position storageOffset (>=1).
Returns a tensor which uses the existing Storage storage, starting at position storageOffset (>=1). The size of each dimension of the tensor is given by the optional Array size. If not given, the size will be computed as the length of storage. The jump necessary to go from one element to the next one in each dimension is given by the optional Array stride. If not given, the stride() will be computed such that the tensor is as contiguous as possible in memory.
-
def
apply[T](data: Array[T], shape: Array[Int])(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Returns a tensor with the given array and shape
Returns a tensor with the given array and shape
- data
the given storage
- shape
the given shape
-
def
apply[T](storage: Storage[T])(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Returns a tensor which uses the existing Storage storage.
Returns a tensor which uses the existing Storage storage.
- storage
the given storage
-
def
apply[T](sizes: Array[Int])(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Create a tensor on given sizes.
Create a tensor on given sizes. The tensor size will be the product of sizes
-
def
apply[T](dims: Int*)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Create a tensor on given dimensions.
Create a tensor on given dimensions. The tensor size will be the product of dims
-
def
apply[T](xs: Table)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Create a tensor with a table
Create a tensor with a table
- xs
the table contains a multi-dimensional numbers
- returns
a new Tensor
- def apply[T](d1: Int, d2: Int, d3: Int, d4: Int, d5: Int)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
- def apply[T](d1: Int, d2: Int, d3: Int, d4: Int)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
- def apply[T](d1: Int, d2: Int, d3: Int)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
- def apply[T](d1: Int, d2: Int)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
-
def
apply[T](d1: Int)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Create a tensor up to 5 dimensions.
Create a tensor up to 5 dimensions. The tensor size will be
d1 x d2 x d3 x d4 x d5. -
def
apply[T]()(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Returns an empty tensor.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
dense[T](sparseTensor: Tensor[T], res: Tensor[T] = null)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Transform a sparseTensor to DenseTensor.
Transform a sparseTensor to DenseTensor.
- sparseTensor
a sparse tensor
- res
if defined, override to res, else will generate a new tensor.
- returns
a DenseTensor.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
expand[T](tensor: Tensor[T], sizes: Int*): Tensor[T]
This is equivalent to tensor.expand(sizes.toArray)
-
def
expandAs[T](tensor: Tensor[T], template: Tensor[T]): Tensor[T]
This is equivalent to tensor.expandAs(template)
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
gaussian1D[T](size: Int = 3, sigma: Double = 0.25, amplitude: Int = 1, normalize: Boolean = false, mean: Double = 0.5, tensor: Tensor[T] = null)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Returns a 1D Gaussian kernel of size size, mean mean and standard deviation sigma.
Returns a 1D Gaussian kernel of size size, mean mean and standard deviation sigma.
- tensor
If tensor is set, will discard size, and write result to tensor.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def load[T](path: String): Tensor[T]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
ones[T](sizes: Int*)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
return a tensor of sizes filled with 1.
return a tensor of sizes filled with 1.
- returns
a tensor
-
def
randperm[T](size: Int)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
This is equivalent to DenseTensor.randperm[T](size)
-
def
range[T](xmin: Double, xmax: Double, step: Int = 1)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
This is equivalent to DenseTensor.range(xmin, xmax, step)
-
def
repeatTensor[T](tensor: Tensor[T], sizes: Int*): Tensor[T]
This is equivalent to tensor.repeatTensor(sizes.toArray)
-
def
scalar[T](value: T)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Create a scalar tensor of this value
Create a scalar tensor of this value
- returns
the created scalar tensor
-
def
sparse[T](shape: Array[Int], nElement: Int = 1)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Create a sparse tensor with shape and number of non-zero elements.
Create a sparse tensor with shape and number of non-zero elements.
- shape
tensor's shape.
- nElement
number of non-zero elements.
-
def
sparse[T](denseTensor: Tensor[T])(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Transform a DenseTensor to SparseTensor.
-
def
sparse[T](indices: Array[Array[Int]], values: Array[T], shape: Array[Int], dimension: Int)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Create a SparseTensor.
Create a SparseTensor.
- indices
dimension-D array to describe the indices of values, should be zero-based and ascending.
- values
non-zero values in this SparseTensor.
- shape
shape
- dimension
dimension
-
def
sparse[T](indices: Array[Array[Int]], values: Storage[T], shape: Array[Int], dimension: Int)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Create a SparseTensor.
Create a SparseTensor.
- indices
dimension-D array to describe the indices of values, should be zero-based and ascending.
- values
non-zero values in this SparseTensor.
- shape
shape
- dimension
dimension
-
def
sparse[T](indices: Array[Array[Int]], values: Array[T], shape: Array[Int])(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Create a SparseTensor.
Create a SparseTensor.
- indices
dimension-D array to describe the indices of values, should be zero-based and ascending.
- values
non-zero values in this SparseTensor.
- shape
shape
-
def
sparse[T](indices: Array[Array[Int]], values: Storage[T], shape: Array[Int])(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): Tensor[T]
Create a SparseTensor.
Create a SparseTensor.
- indices
dimension-D array to describe the indices of values, should be zero-based and ascending.
- values
non-zero values in this SparseTensor.
- shape
shape
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unique[T](tensor: Tensor[T], distinctBuffer: Tensor[T] = null, indicesBuffer: Tensor[Int] = null)(implicit arg0: ClassTag[T], ev: TensorNumeric[T]): (Tensor[T], Tensor[Int])
Find the distinct value and its indices in a 1D tensor.
Find the distinct value and its indices in a 1D tensor.
- tensor
a 1D tensor
- distinctBuffer
a buffer for its distinct values.
- indicesBuffer
a buffer for its indcies.
- returns
(distinctValues, indices)
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )