Trait/Object

com.intel.analytics.bigdl.tensor

Tensor

Related Docs: object Tensor | package tensor

Permalink

trait Tensor[T] extends Serializable with TensorMath[T] with Activity

It is the class for handling numeric data.

T

should be Double or Float

Linear Supertypes
Activity, TensorMath[T], Serializable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Tensor
  2. Activity
  3. TensorMath
  4. Serializable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def *(t: Tensor[T]): Tensor[T]

    Permalink

    Multiply a Tensor by another one, return the result in new allocated memory.

    Multiply a Tensor by another one, return the result in new allocated memory. The number of elements in the Tensors must match, but the sizes do not matter. The size of the returned Tensor will be the size of the first Tensor

    Definition Classes
    TensorMath
  2. abstract def *(s: T): Tensor[T]

    Permalink

    multiply all elements of this with value not in place.

    multiply all elements of this with value not in place. It will allocate new memory.

    Definition Classes
    TensorMath
  3. abstract def +(t: Tensor[T]): Tensor[T]

    Permalink

    Add a Tensor to another one, return the result in new allocated memory.

    Add a Tensor to another one, return the result in new allocated memory. The number of elements in the Tensors must match, but the sizes do not matter. The size of the returned Tensor will be the size of the first Tensor

    Definition Classes
    TensorMath
  4. abstract def +(s: T): Tensor[T]

    Permalink

    Add all elements of this with value not in place.

    Add all elements of this with value not in place. It will allocate new memory.

    Definition Classes
    TensorMath
  5. abstract def -(t: Tensor[T]): Tensor[T]

    Permalink

    Subtract a Tensor from another one, return the result in new allocated memory.

    Subtract a Tensor from another one, return the result in new allocated memory. The number of elements in the Tensors must match, but the sizes do not matter. The size of the returned Tensor will be the size of the first Tensor

    Definition Classes
    TensorMath
  6. abstract def -(s: T): Tensor[T]

    Permalink

    subtract all elements of this with the value not in place.

    subtract all elements of this with the value not in place. It will allocate new memory.

    Definition Classes
    TensorMath
  7. abstract def /(t: Tensor[T]): Tensor[T]

    Permalink

    Divide a Tensor by another one, return the result in new allocated memory.

    Divide a Tensor by another one, return the result in new allocated memory. The number of elements in the Tensors must match, but the sizes do not matter. The size of the returned Tensor will be the size of the first Tensor

    Definition Classes
    TensorMath
  8. abstract def /(s: T): Tensor[T]

    Permalink

    divide all elements of this with value not in place.

    divide all elements of this with value not in place. It will allocate new memory.

    Definition Classes
    TensorMath
  9. abstract def abs(x: Tensor[T]): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  10. abstract def abs(): Tensor[T]

    Permalink

    replaces all elements in-place with the absolute values of the elements of this.

    replaces all elements in-place with the absolute values of the elements of this.

    Definition Classes
    TensorMath
  11. abstract def add(x: Tensor[T], y: Tensor[T]): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  12. abstract def add(value: T): Tensor[T]

    Permalink

    x.add(value) : add value to all elements of x in place.

    x.add(value) : add value to all elements of x in place.

    Definition Classes
    TensorMath
  13. abstract def add(x: Tensor[T], value: T, y: Tensor[T]): Tensor[T]

    Permalink

    z.add(x, value, y) puts the result of x + value * y in z.

    z.add(x, value, y) puts the result of x + value * y in z.

    Definition Classes
    TensorMath
  14. abstract def add(y: Tensor[T]): Tensor[T]

    Permalink

    accumulates all elements of y into this

    accumulates all elements of y into this

    y

    other tensor

    returns

    current tensor

    Definition Classes
    TensorMath
  15. abstract def add(value: T, y: Tensor[T]): Tensor[T]

    Permalink

    x.add(value,y) multiply-accumulates values of y into x.

    x.add(value,y) multiply-accumulates values of y into x.

    value

    scalar

    y

    other tensor

    returns

    current tensor

    Definition Classes
    TensorMath
  16. abstract def addMultiDimension(t: Tensor[T] = this, dims: Array[Int] = Array(1)): Tensor[T]

    Permalink

    view this.tensor and add multiple Dimensions to dim dimension

    view this.tensor and add multiple Dimensions to dim dimension

    t

    source tensor

    returns

    this

  17. abstract def addSingletonDimension(t: Tensor[T] = this, dim: Int = 1): Tensor[T]

    Permalink

    view this.tensor and add a Singleton Dimension to dim dimension

    view this.tensor and add a Singleton Dimension to dim dimension

    t

    source tensor

    dim

    the specific dimension, default is 1

    returns

    this

  18. abstract def addcdiv(value: T, tensor1: Tensor[T], tensor2: Tensor[T]): Tensor[T]

    Permalink

    Performs the element-wise division of tensor1 by tensor2, multiply the result by the scalar value and add it to x.

    Performs the element-wise division of tensor1 by tensor2, multiply the result by the scalar value and add it to x. The number of elements must match, but sizes do not matter.

    Definition Classes
    TensorMath
  19. abstract def addcmul(tensor1: Tensor[T], tensor2: Tensor[T]): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  20. abstract def addcmul(value: T, tensor1: Tensor[T], tensor2: Tensor[T]): Tensor[T]

    Permalink

    Performs the element-wise multiplication of tensor1 by tensor2, multiply the result by the scalar value (1 if not present) and add it to x.

    Performs the element-wise multiplication of tensor1 by tensor2, multiply the result by the scalar value (1 if not present) and add it to x. The number of elements must match, but sizes do not matter.

    Definition Classes
    TensorMath
  21. abstract def addmm(v1: T, v2: T, mat1: Tensor[T], mat2: Tensor[T]): Tensor[T]

    Permalink

    res = v1 * res + v2 * mat1*mat2

    res = v1 * res + v2 * mat1*mat2

    Definition Classes
    TensorMath
  22. abstract def addmm(v2: T, mat1: Tensor[T], mat2: Tensor[T]): Tensor[T]

    Permalink

    res = res + v2 * mat1 * mat2

    res = res + v2 * mat1 * mat2

    Definition Classes
    TensorMath
  23. abstract def addmm(mat1: Tensor[T], mat2: Tensor[T]): Tensor[T]

    Permalink

    res = res + mat1 * mat2

    res = res + mat1 * mat2

    Definition Classes
    TensorMath
  24. abstract def addmm(M: Tensor[T], mat1: Tensor[T], mat2: Tensor[T]): Tensor[T]

    Permalink

    res = M + (mat1*mat2)

    res = M + (mat1*mat2)

    Definition Classes
    TensorMath
  25. abstract def addmm(v1: T, M: Tensor[T], v2: T, mat1: Tensor[T], mat2: Tensor[T]): Tensor[T]

    Permalink

    Performs a matrix-matrix multiplication between mat1 (2D tensor) and mat2 (2D tensor).

    Performs a matrix-matrix multiplication between mat1 (2D tensor) and mat2 (2D tensor). Optional values v1 and v2 are scalars that multiply M and mat1 * mat2 respectively. Optional value beta is a scalar that scales the result tensor, before accumulating the result into the tensor. Defaults to 1.0. If mat1 is a n x m matrix, mat2 a m x p matrix, M must be a n x p matrix.

    res = (v1 * M) + (v2 * mat1*mat2)

    Definition Classes
    TensorMath
  26. abstract def addmv(alpha: T, mat: Tensor[T], vec2: Tensor[T]): Tensor[T]

    Permalink

    res = res + alpha * (mat * vec2)

    res = res + alpha * (mat * vec2)

    Definition Classes
    TensorMath
  27. abstract def addmv(beta: T, alpha: T, mat: Tensor[T], vec2: Tensor[T]): Tensor[T]

    Permalink

    res = beta * res + alpha * (mat * vec2)

    res = beta * res + alpha * (mat * vec2)

    Definition Classes
    TensorMath
  28. abstract def addmv(beta: T, vec1: Tensor[T], alpha: T, mat: Tensor[T], vec2: Tensor[T]): Tensor[T]

    Permalink

    Performs a matrix-vector multiplication between mat (2D Tensor) and vec2 (1D Tensor) and add it to vec1.

    Performs a matrix-vector multiplication between mat (2D Tensor) and vec2 (1D Tensor) and add it to vec1. Optional values v1 and v2 are scalars that multiply vec1 and vec2 respectively.

    In other words, res = (beta * vec1) + alpha * (mat * vec2)

    Sizes must respect the matrix-multiplication operation: if mat is a n × m matrix, vec2 must be vector of size m and vec1 must be a vector of size n.

    Definition Classes
    TensorMath
  29. abstract def addr(v1: T, t1: Tensor[T], v2: T, t2: Tensor[T], t3: Tensor[T]): Tensor[T]

    Permalink

    Performs the outer-product between vec1 (1D Tensor) and vec2 (1D Tensor).

    Performs the outer-product between vec1 (1D Tensor) and vec2 (1D Tensor). Optional values v1 and v2 are scalars that multiply mat and vec1 [out] vec2 respectively. In other words,res_ij = (v1 * mat_ij) + (v2 * vec1_i * vec2_j)

    Definition Classes
    TensorMath
  30. abstract def addr(v1: T, t1: Tensor[T], v2: T, t2: Tensor[T]): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  31. abstract def addr(v1: T, t1: Tensor[T], t2: Tensor[T]): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  32. abstract def addr(t1: Tensor[T], t2: Tensor[T]): Tensor[T]

    Permalink

    Performs the outer-product between vec1 (1D tensor) and vec2 (1D tensor).

    Performs the outer-product between vec1 (1D tensor) and vec2 (1D tensor). Optional values v1 and v2 are scalars that multiply mat and vec1 [out] vec2 respectively. In other words, res_ij = (v1 * mat_ij) + (v2 * vec1_i * vec2_j)

    Definition Classes
    TensorMath
  33. abstract def apply(t: Table): Tensor[T]

    Permalink

    Subset the tensor by apply the elements of the given table to the corresponding dimension of the tensor.

    Subset the tensor by apply the elements of the given table to the corresponding dimension of the tensor. The elements of the given table can be an Int or another Table. An Int means select on current dimension; A table means narrow on current dimension, the table should have two elements, of which the first is the start index and the second is the end index. An empty table is equal to Table(1, size_of_current_dimension) If the table length is less than the tensor dimension, each missing dimension is token up by an empty table

    t

    The table length should be less than or equal to the tensor dimensions

    See also

    narrow

    select

  34. abstract def apply(indexes: Array[Int]): T

    Permalink

    Query the value on a given index.

    Query the value on a given index. Tensor should not be empty

    indexes

    the indexes length should be same as the tensor dimension length and each value count from 1

    returns

    the value on the given index

  35. abstract def apply(index: Int): Tensor[T]

    Permalink

    Query tensor on a given index.

    Query tensor on a given index. Tensor should not be empty

    index

    count from 1

  36. abstract def apply1(func: (T) ⇒ T): Tensor[T]

    Permalink

    Apply a function to each element of the tensor and modified it value if it return a double

    Apply a function to each element of the tensor and modified it value if it return a double

    func

    applied function

    returns

    current tensor

  37. abstract def applyFun[A](t: Tensor[A], func: (A) ⇒ T)(implicit arg0: ClassTag[A]): Tensor[T]

    Permalink

    Apply a function to each element of the tensor t and set each value to self

    Apply a function to each element of the tensor t and set each value to self

    t

    tensor to be modified

    func

    applied function

    returns

    current tensor

  38. abstract def baddbmm(alpha: T, batch1: Tensor[T], batch2: Tensor[T]): Tensor[T]

    Permalink

    res_i = res_i + (alpha * batch1_i * batch2_i)

    res_i = res_i + (alpha * batch1_i * batch2_i)

    Definition Classes
    TensorMath
  39. abstract def baddbmm(beta: T, alpha: T, batch1: Tensor[T], batch2: Tensor[T]): Tensor[T]

    Permalink

    res_i = (beta * res_i) + (alpha * batch1_i * batch2_i)

    res_i = (beta * res_i) + (alpha * batch1_i * batch2_i)

    Definition Classes
    TensorMath
  40. abstract def baddbmm(beta: T, M: Tensor[T], alpha: T, batch1: Tensor[T], batch2: Tensor[T]): Tensor[T]

    Permalink

    Perform a batch matrix matrix multiplication of matrices and stored in batch1 and batch2 with batch add.

    Perform a batch matrix matrix multiplication of matrices and stored in batch1 and batch2 with batch add. batch1 and batch2 must be 3D Tensors each containing the same number of matrices. If batch1 is a b × n × m Tensor, batch2 a b × m × p Tensor, res will be a b × n × p Tensor.

    In other words, res_i = (beta * M_i) + (alpha * batch1_i * batch2_i)

    Definition Classes
    TensorMath
  41. abstract def bernoulli(p: Double): Tensor[T]

    Permalink

    Fill with random value(bernoulli distribution).

    Fill with random value(bernoulli distribution). It will change the value of the current tensor and return itself

    returns

    current tensor

  42. abstract def bmm(batch1: Tensor[T], batch2: Tensor[T]): Tensor[T]

    Permalink

    res_i = res_i + batch1_i * batch2_i

    res_i = res_i + batch1_i * batch2_i

    Definition Classes
    TensorMath
  43. abstract def cast[D](castTensor: Tensor[D])(implicit arg0: ClassTag[D], ev: TensorNumeric[D]): Tensor[D]

    Permalink

    Cast the currenct tensor to a tensor with tensor numeric type D and set cast value to castTensor

    Cast the currenct tensor to a tensor with tensor numeric type D and set cast value to castTensor

    D

    new numeric type

    castTensor

    the cast value set to this tensor

    returns

    return castTensort

  44. abstract def cdiv(x: Tensor[T], y: Tensor[T]): Tensor[T]

    Permalink

    Element-wise divide z.cdiv(x, y) means z = x / y

    Element-wise divide z.cdiv(x, y) means z = x / y

    x

    tensor

    y

    tensor

    returns

    current tensor

    Definition Classes
    TensorMath
  45. abstract def cdiv(y: Tensor[T]): Tensor[T]

    Permalink

    Element-wise divide x.cdiv(y) all elements of x divide all elements of y.

    Element-wise divide x.cdiv(y) all elements of x divide all elements of y. x = x / y

    y

    tensor

    returns

    current tensor

    Definition Classes
    TensorMath
  46. abstract def ceil(): Tensor[T]

    Permalink

    Replaces all elements in-place with the ceil result of elements

    Replaces all elements in-place with the ceil result of elements

    Definition Classes
    TensorMath
  47. abstract def clamp(min: Double, max: Double): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  48. abstract def cmax(x: Tensor[T], y: Tensor[T]): Tensor[T]

    Permalink

    stores the element-wise maximum of x and y in z.

    stores the element-wise maximum of x and y in z. z.cmax(x, y) means z = max(x, y)

    x

    tensor

    y

    tensor

    Definition Classes
    TensorMath
  49. abstract def cmax(y: Tensor[T]): Tensor[T]

    Permalink

    stores the element-wise maximum of x and y in x.

    stores the element-wise maximum of x and y in x. x.cmax(y) = max(x, y)

    y

    tensor

    returns

    current tensor

    Definition Classes
    TensorMath
  50. abstract def cmax(value: T): Tensor[T]

    Permalink

    For each elements of the tensor, performs the max operation compared with the given value vector.

    For each elements of the tensor, performs the max operation compared with the given value vector.

    Definition Classes
    TensorMath
  51. abstract def cmin(x: Tensor[T], y: Tensor[T]): Tensor[T]

    Permalink

    stores the element-wise maximum of x and y in z.

    stores the element-wise maximum of x and y in z. z.cmin(x, y) means z = min(x, y)

    x

    tensor

    y

    tensor

    Definition Classes
    TensorMath
  52. abstract def cmin(y: Tensor[T]): Tensor[T]

    Permalink

    stores the element-wise maximum of x and y in x.

    stores the element-wise maximum of x and y in x. x.cmin(y) = min(x, y)

    y

    tensor

    returns

    current tensor

    Definition Classes
    TensorMath
  53. abstract def cmul(x: Tensor[T], y: Tensor[T]): Tensor[T]

    Permalink

    Element-wise multiply z.cmul(x, y) equals z = x * y

    Element-wise multiply z.cmul(x, y) equals z = x * y

    x

    tensor

    y

    tensor

    returns

    current tensor

    Definition Classes
    TensorMath
  54. abstract def cmul(y: Tensor[T]): Tensor[T]

    Permalink

    Element-wise multiply x.cmul(y) multiplies all elements of x with corresponding elements of y.

    Element-wise multiply x.cmul(y) multiplies all elements of x with corresponding elements of y. x = x * y

    y

    tensor

    returns

    current tensor

    Definition Classes
    TensorMath
  55. abstract def contiguous(): Tensor[T]

    Permalink

    Get a contiguous tensor from current tensor

    Get a contiguous tensor from current tensor

    returns

    the current tensor if it's contiguous; or a new contiguous tensor with separated storage

  56. abstract def conv2(kernel: Tensor[T], vf: Char = 'V'): Tensor[T]

    Permalink

    This function computes 2 dimensional convolution of a single image with a single kernel (2D output).

    This function computes 2 dimensional convolution of a single image with a single kernel (2D output). the dimensions of input and kernel need to be 2, and Input image needs to be bigger than kernel. The last argument controls if the convolution is a full ('F') or valid ('V') convolution. The default is valid convolution.

    vf

    full ('F') or valid ('V') convolution.

    Definition Classes
    TensorMath
  57. abstract def copy(other: Tensor[T]): Tensor[T]

    Permalink

    Copy the value of the given tensor to the current.

    Copy the value of the given tensor to the current. They should have same size. It will use the old storage

    other

    source tensor

    returns

    current tensor

  58. abstract def diff(other: Tensor[T], count: Int = 1, reverse: Boolean = false): Boolean

    Permalink

    Compare and print differences between two tensors

    Compare and print differences between two tensors

    returns

    true if there's difference, vice versa

  59. abstract def digamma(): Tensor[T]

    Permalink

    Computes Psi, the derivative of Lgamma (the log of the absolute value of Gamma(x)), element-wise and update the content inplace

    Computes Psi, the derivative of Lgamma (the log of the absolute value of Gamma(x)), element-wise and update the content inplace

    Definition Classes
    TensorMath
  60. abstract def dim(): Int

    Permalink

    A shortcut of nDimension()

    A shortcut of nDimension()

    See also

    nDimension()

  61. abstract def dist(y: Tensor[T], norm: Int): T

    Permalink

    Performs the p-norm distance calculation between two tensors

    Performs the p-norm distance calculation between two tensors

    y

    the secode Tensor

    norm

    the norm of distance

    Definition Classes
    TensorMath
  62. abstract def div(y: Tensor[T]): Tensor[T]

    Permalink

    Element-wise divide x.div(y) all elements of x divide all elements of y.

    Element-wise divide x.div(y) all elements of x divide all elements of y. x = x / y

    y

    tensor

    returns

    current tensor

    Definition Classes
    TensorMath
  63. abstract def div(value: T): Tensor[T]

    Permalink

    divide all elements of this with value in-place.

    divide all elements of this with value in-place.

    Definition Classes
    TensorMath
  64. abstract def dot(y: Tensor[T]): T

    Permalink

    Performs the dot product.

    Performs the dot product. The number of elements must match: both Tensors are seen as a 1D vector.

    Definition Classes
    TensorMath
  65. abstract def emptyInstance(): Tensor[T]

    Permalink

    return a new empty tensor of the same type

    return a new empty tensor of the same type

    returns

    new tensor

  66. abstract def eq(x: Tensor[T], y: T): Tensor[T]

    Permalink

    Implements == operator comparing each element in x with y

    Implements == operator comparing each element in x with y

    returns

    current tensor reference

    Definition Classes
    TensorMath
  67. abstract def erf(): Tensor[T]

    Permalink

    Computes the reciprocal of this tensor element-wise and update the content inplace

    Computes the reciprocal of this tensor element-wise and update the content inplace

    Definition Classes
    TensorMath
  68. abstract def erfc(): Tensor[T]

    Permalink

    Computes the reciprocal of this tensor element-wise and update the content inplace

    Computes the reciprocal of this tensor element-wise and update the content inplace

    Definition Classes
    TensorMath
  69. abstract def exp(): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  70. abstract def exp(y: Tensor[T]): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  71. abstract def expand(sizes: Array[Int]): Tensor[T]

    Permalink

    Expanding a tensor allocates new memory, tensor where singleton dimensions can be expanded to multiple ones by setting the stride to 0.

    Expanding a tensor allocates new memory, tensor where singleton dimensions can be expanded to multiple ones by setting the stride to 0. Any dimension that has size 1 can be expanded to arbitrary value with new memory allocation. Attempting to expand along a dimension that does not have size 1 will result in an error.

    sizes

    the size that tensor will expend to

  72. abstract def expandAs(template: Tensor[T]): Tensor[T]

    Permalink

    This is equivalent to this.expand(template.size())

    This is equivalent to this.expand(template.size())

    template

    the given tensor

  73. abstract def fill(v: T): Tensor[T]

    Permalink

    Fill with a given value.

    Fill with a given value. It will change the value of the current tensor and return itself

    v

    value to fill the tensor

    returns

    current tensor

  74. abstract def floor(): Tensor[T]

    Permalink

    Replaces all elements in-place with the floor result of elements

    Replaces all elements in-place with the floor result of elements

    Definition Classes
    TensorMath
  75. abstract def floor(y: Tensor[T]): Tensor[T]

    Permalink

    Populate the given tensor with the floor result of elements

    Populate the given tensor with the floor result of elements

    Definition Classes
    TensorMath
  76. abstract def forceFill(v: Any): Tensor[T]

    Permalink

    Fill with a given value.

    Fill with a given value. It will change the value of the current tensor and return itself

    Note the value should be an instance of T

    v

    value to fill the tensor

    returns

    current tensor

  77. abstract def gather(dim: Int, index: Tensor[T], src: Tensor[T]): Tensor[T]

    Permalink

    change this tensor with values from the original tensor by gathering a number of values from each "row", where the rows are along the dimension dim.

    change this tensor with values from the original tensor by gathering a number of values from each "row", where the rows are along the dimension dim.

    returns

    this

    Definition Classes
    TensorMath
  78. abstract def ge(x: Tensor[T], value: Double): Tensor[T]

    Permalink

    Implements >= operator comparing each element in x with value

    Implements >= operator comparing each element in x with value

    Definition Classes
    TensorMath
  79. abstract def getTensorNumeric(): TensorNumeric[T]

    Permalink

    Return tensor numeric

  80. abstract def getTensorType: TensorType

    Permalink

    Return tensor type

    Return tensor type

    returns

    Dense / Quant

  81. abstract def getType(): TensorDataType

    Permalink

    return the tensor datatype( DoubleType or FloatType)

  82. abstract def gt(x: Tensor[T], y: Tensor[T]): Tensor[T]

    Permalink

    Implements > operator comparing each element in x with y

    Implements > operator comparing each element in x with y

    returns

    current tensor reference

    Definition Classes
    TensorMath
  83. abstract def index(dim: Int, index: Tensor[T], y: Tensor[T]): Tensor[T]

    Permalink

    Accumulate the elements of tensor into the original tensor by adding to the indices in the order given in index.

    Accumulate the elements of tensor into the original tensor by adding to the indices in the order given in index. The shape of tensor must exactly match the elements indexed or an error will be thrown.

    Definition Classes
    TensorMath
  84. abstract def indexAdd(dim: Int, index: Tensor[T], y: Tensor[T]): Tensor[T]

    Permalink

    Accumulate the elements of tensor into the original tensor by adding to the indices in the order given in index.

    Accumulate the elements of tensor into the original tensor by adding to the indices in the order given in index. The shape of tensor must exactly match the elements indexed or an error will be thrown.

    Definition Classes
    TensorMath
  85. abstract def inv(): Tensor[T]

    Permalink

    Computes the reciprocal of this tensor element-wise and update the content inplace

    Computes the reciprocal of this tensor element-wise and update the content inplace

    Definition Classes
    TensorMath
  86. abstract def isContiguous(): Boolean

    Permalink

    Check if the tensor is contiguous on the storage

    Check if the tensor is contiguous on the storage

    returns

    true if it's contiguous

  87. abstract def isEmpty: Boolean

    Permalink

    returns

    whether this tensor is an empty tensor. Note that nDimension == 0 is not sufficient to determine a tensor is empty, because a scalar tensor's nDimension is also 0.

  88. abstract def isSameSizeAs(other: Tensor[_]): Boolean

    Permalink

    Check if the size is same with the give tensor

    Check if the size is same with the give tensor

    other

    tensor to be compared

    returns

    true if they have same size

  89. abstract def isScalar: Boolean

    Permalink

    returns

    whether this tensor is a scalar

  90. abstract def le(x: Tensor[T], y: Tensor[T]): Tensor[T]

    Permalink

    Implements <= operator comparing each element in x with y

    Implements <= operator comparing each element in x with y

    returns

    current tensor reference

    Definition Classes
    TensorMath
  91. abstract def log(): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  92. abstract def log(y: Tensor[T]): Tensor[T]

    Permalink

    Replaces all elements in-place with the elements of lnx

    Replaces all elements in-place with the elements of lnx

    returns

    current tensor reference

    Definition Classes
    TensorMath
  93. abstract def log1p(): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  94. abstract def log1p(y: Tensor[T]): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  95. abstract def logGamma(): Tensor[T]

    Permalink

    Computes the log of the absolute value of Gamma(x) element-wise, and update the content inplace

    Computes the log of the absolute value of Gamma(x) element-wise, and update the content inplace

    Definition Classes
    TensorMath
  96. abstract def lt(x: Tensor[T], y: Tensor[T]): Tensor[T]

    Permalink

    Implements < operator comparing each element in x with y

    Implements < operator comparing each element in x with y

    returns

    current tensor reference

    Definition Classes
    TensorMath
  97. abstract def map(other: Tensor[T], func: (T, T) ⇒ T): Tensor[T]

    Permalink

    Map value of another tensor to corresponding value of current tensor and apply function on the two value and change the value of the current tensor The another tensor should has the same size of the current tensor

    Map value of another tensor to corresponding value of current tensor and apply function on the two value and change the value of the current tensor The another tensor should has the same size of the current tensor

    other

    another tensor

    func

    applied function

    returns

    current tensor

  98. abstract def maskedCopy(mask: Tensor[T], y: Tensor[T]): Tensor[T]

    Permalink

    Copies the elements of tensor into mask locations of itself.

    Copies the elements of tensor into mask locations of itself.

    returns

    current tensor reference

    Definition Classes
    TensorMath
  99. abstract def maskedFill(mask: Tensor[T], e: T): Tensor[T]

    Permalink

    Fills the masked elements of itself with value val

    Fills the masked elements of itself with value val

    returns

    current tensor reference

    Definition Classes
    TensorMath
  100. abstract def maskedSelect(mask: Tensor[T], y: Tensor[T]): Tensor[T]

    Permalink

    Returns a new Tensor which contains all elements aligned to a 1 in the corresponding mask.

    Returns a new Tensor which contains all elements aligned to a 1 in the corresponding mask.

    returns

    current tensor reference

    Definition Classes
    TensorMath
  101. abstract def max(values: Tensor[T], indices: Tensor[T], dim: Int): (Tensor[T], Tensor[T])

    Permalink

    performs the max operation over the dimension n

    performs the max operation over the dimension n

    Definition Classes
    TensorMath
  102. abstract def max(dim: Int): (Tensor[T], Tensor[T])

    Permalink

    performs the max operation over the dimension n

    performs the max operation over the dimension n

    Definition Classes
    TensorMath
  103. abstract def max(): T

    Permalink

    returns the single biggest element of x

    returns the single biggest element of x

    Definition Classes
    TensorMath
  104. abstract def mean(dim: Int): Tensor[T]

    Permalink

    performs the mean operation over the dimension dim.

    performs the mean operation over the dimension dim.

    Definition Classes
    TensorMath
  105. abstract def mean(): T

    Permalink

    returns the mean of all elements of this.

    returns the mean of all elements of this.

    Definition Classes
    TensorMath
  106. abstract def min(values: Tensor[T], indices: Tensor[T], dim: Int): (Tensor[T], Tensor[T])

    Permalink

    performs the min operation over the dimension n

    performs the min operation over the dimension n

    Definition Classes
    TensorMath
  107. abstract def min(dim: Int): (Tensor[T], Tensor[T])

    Permalink

    performs the min operation over the dimension n

    performs the min operation over the dimension n

    Definition Classes
    TensorMath
  108. abstract def min(): T

    Permalink

    returns the single minimum element of x

    returns the single minimum element of x

    Definition Classes
    TensorMath
  109. abstract def mm(mat1: Tensor[T], mat2: Tensor[T]): Tensor[T]

    Permalink

    res = mat1*mat2

    res = mat1*mat2

    Definition Classes
    TensorMath
  110. abstract def mul(x: Tensor[T], value: T): Tensor[T]

    Permalink

    put the result of x * value in current tensor

    put the result of x * value in current tensor

    Definition Classes
    TensorMath
  111. abstract def mul(value: T): Tensor[T]

    Permalink

    multiply all elements of this with value in-place.

    multiply all elements of this with value in-place.

    Definition Classes
    TensorMath
  112. abstract def mv(mat: Tensor[T], vec2: Tensor[T]): Tensor[T]

    Permalink

    res = res + (mat * vec2)

    res = res + (mat * vec2)

    Definition Classes
    TensorMath
  113. abstract def nDimension(): Int

    Permalink

    Dimension number of the tensor.

    Dimension number of the tensor. For empty tensor, its dimension number is 0

    returns

    dimension number

  114. abstract def nElement(): Int

    Permalink

    Element number

    Element number

    returns

    element number

  115. abstract def narrow(dim: Int, index: Int, size: Int): Tensor[T]

    Permalink

    Get a subset of the tensor on dim-th dimension.

    Get a subset of the tensor on dim-th dimension. The offset is given by index, and length is given by size. The important difference with select is that it will not reduce the dimension number. For Instance tensor = 1 2 3 4 5 6 tensor.narrow(1, 1, 1) is [1 2 3] tensor.narrow(2, 2, 2) is 2 3 5 6

  116. abstract def negative(x: Tensor[T]): Tensor[T]

    Permalink

    Computes numerical negative value element-wise.

    Computes numerical negative value element-wise. y = -x

    returns

    this tensor

    Definition Classes
    TensorMath
  117. abstract def norm(value: Int): T

    Permalink

    returns the sum of the n-norms on the Tensor x

    returns the sum of the n-norms on the Tensor x

    value

    the n-norms

    Definition Classes
    TensorMath
  118. abstract def norm(y: Tensor[T], value: Int, dim: Int): Tensor[T]

    Permalink

    returns the p-norms of the Tensor x computed over the dimension dim.

    returns the p-norms of the Tensor x computed over the dimension dim.

    y

    result buffer

    Definition Classes
    TensorMath
  119. abstract def pow(n: T): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  120. abstract def pow(y: Tensor[T], n: T): Tensor[T]

    Permalink

    Replaces all elements in-place with the elements of x to the power of n

    Replaces all elements in-place with the elements of x to the power of n

    returns

    current tensor reference

    Definition Classes
    TensorMath
  121. abstract def prod(x: Tensor[T], dim: Int): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  122. abstract def prod(): T

    Permalink

    returns the product of the elements of this

    returns the product of the elements of this

    Definition Classes
    TensorMath
  123. abstract def rand(lowerBound: Double, upperBound: Double): Tensor[T]

    Permalink

    Fill with random value(uniform distribution between [lowerBound, upperBound]) It will change the value of the current tensor and return itself

    Fill with random value(uniform distribution between [lowerBound, upperBound]) It will change the value of the current tensor and return itself

    returns

    current tensor

  124. abstract def rand(): Tensor[T]

    Permalink

    Fill with random value(uniform distribution).

    Fill with random value(uniform distribution). It will change the value of the current tensor and return itself

    returns

    current tensor

  125. abstract def randn(mean: Double, stdv: Double): Tensor[T]

    Permalink

    Fill with random value(normal gaussian distribution with the specified mean and stdv).

    Fill with random value(normal gaussian distribution with the specified mean and stdv). It will change the value of the current tensor and return itself

    returns

    current tensor

  126. abstract def randn(): Tensor[T]

    Permalink

    Fill with random value(normal gaussian distribution).

    Fill with random value(normal gaussian distribution). It will change the value of the current tensor and return itself

    returns

    current tensor

  127. abstract def range(xmin: Double, xmax: Double, step: Int = 1): Tensor[T]

    Permalink

    resize this tensor size to floor((xmax - xmin) / step) + 1 and set values from xmin to xmax with step (default to 1).

    resize this tensor size to floor((xmax - xmin) / step) + 1 and set values from xmin to xmax with step (default to 1).

    returns

    this tensor

    Definition Classes
    TensorMath
  128. abstract def reduce(dim: Int, result: Tensor[T], reducer: (T, T) ⇒ T): Tensor[T]

    Permalink

    Reduce along the given dimension with the given reducer, and copy the result to the result tensor

    Reduce along the given dimension with the given reducer, and copy the result to the result tensor

    Definition Classes
    TensorMath
  129. abstract def repeatTensor(sizes: Array[Int]): Tensor[T]

    Permalink

    Repeating a tensor allocates new memory, unless result is provided, in which case its memory is resized.

    Repeating a tensor allocates new memory, unless result is provided, in which case its memory is resized. sizes specify the number of times the tensor is repeated in each dimension.

  130. abstract def reshape(sizes: Array[Int]): Tensor[T]

    Permalink

    create a new tensor without any change of the tensor

    create a new tensor without any change of the tensor

    sizes

    the size of the new Tensor

  131. abstract def resize(size1: Int, size2: Int, size3: Int, size4: Int, size5: Int): Tensor[T]

    Permalink
  132. abstract def resize(size1: Int, size2: Int, size3: Int, size4: Int): Tensor[T]

    Permalink
  133. abstract def resize(size1: Int, size2: Int, size3: Int): Tensor[T]

    Permalink
  134. abstract def resize(size1: Int, size2: Int): Tensor[T]

    Permalink
  135. abstract def resize(size1: Int): Tensor[T]

    Permalink
  136. abstract def resize(sizes: Array[Int], strides: Array[Int] = null): Tensor[T]

    Permalink

    Resize the current tensor to the give shape

    Resize the current tensor to the give shape

    sizes

    Array describe the size

    strides

    Array describe the jumps

  137. abstract def resizeAs(src: Tensor[_]): Tensor[T]

    Permalink

    Resize the current tensor to the same size of the given tensor.

    Resize the current tensor to the same size of the given tensor. It will still use the same storage if the storage is sufficient for the new size

    src

    target tensor

    returns

    current tensor

  138. abstract def save(path: String, overWrite: Boolean = false): Tensor.this.type

    Permalink

    Save the tensor to given path

  139. abstract def scatter(dim: Int, index: Tensor[T], src: Tensor[T]): Tensor[T]

    Permalink

    Writes all values from tensor src into this tensor at the specified indices

    Writes all values from tensor src into this tensor at the specified indices

    returns

    this

    Definition Classes
    TensorMath
  140. abstract def select(dim: Int, index: Int): Tensor[T]

    Permalink

    Remove the dim-th dimension and return the subset part.

    Remove the dim-th dimension and return the subset part. For instance tensor = 1 2 3 4 5 6 tensor.select(1, 1) is [1 2 3] tensor.select(1, 2) is [4 5 6] tensor.select(2, 3) is [3 6]

  141. abstract def set(): Tensor[T]

    Permalink

    Shrunk the size of the storage to 0, and also the tensor size

  142. abstract def set(storage: Storage[T], storageOffset: Int = 1, sizes: Array[Int] = null, strides: Array[Int] = null): Tensor[T]

    Permalink

    The Tensor is now going to "view" the given storage, starting at position storageOffset (>=1) with the given dimension sizes and the optional given strides.

    The Tensor is now going to "view" the given storage, starting at position storageOffset (>=1) with the given dimension sizes and the optional given strides. As the result, any modification in the elements of the Storage will have an impact on the elements of the Tensor, and vice-versa. This is an efficient method, as there is no memory copy!

    If only storage is provided, the whole storage will be viewed as a 1D Tensor.

    returns

    current tensor

  143. abstract def set(other: Tensor[T]): Tensor[T]

    Permalink

    The Tensor is now going to "view" the same storage as the given tensor.

    The Tensor is now going to "view" the same storage as the given tensor. As the result, any modification in the elements of the Tensor will have an impact on the elements of the given tensor, and vice-versa. This is an efficient method, as there is no memory copy!

    other

    the given tensor

    returns

    current tensor

  144. abstract def setValue(d1: Int, d2: Int, d3: Int, d4: Int, d5: Int, value: T): Tensor.this.type

    Permalink
  145. abstract def setValue(d1: Int, d2: Int, d3: Int, d4: Int, value: T): Tensor.this.type

    Permalink
  146. abstract def setValue(d1: Int, d2: Int, d3: Int, value: T): Tensor.this.type

    Permalink
  147. abstract def setValue(d1: Int, d2: Int, value: T): Tensor.this.type

    Permalink
  148. abstract def setValue(d1: Int, value: T): Tensor.this.type

    Permalink

    Write the value on a given position.

    Write the value on a given position. The number of parameters should be equal to the dimension number of the tensor.

    value

    the written value

  149. abstract def setValue(value: T): Tensor.this.type

    Permalink

    Set value for a scalar tensor

    Set value for a scalar tensor

    value

    the written value

  150. abstract def sign(): Tensor[T]

    Permalink

    returns a new Tensor with the sign (+/- 1 or 0) of the elements of x.

    returns a new Tensor with the sign (+/- 1 or 0) of the elements of x.

    Definition Classes
    TensorMath
  151. abstract def size(dim: Int): Int

    Permalink

    size of the tensor on the given dimension

    size of the tensor on the given dimension

    dim

    dimension, count from 1

    returns

    size

  152. abstract def size(): Array[Int]

    Permalink

    Size of tensor.

    Size of tensor. Return an array of which each value represents the size on the dimension(i + 1), i is the index of the corresponding value. It will generate a new array each time method is invoked.

    returns

    size array

  153. abstract def split(dim: Int): Array[Tensor[T]]

    Permalink

    spilt one tensor into multi tensor along the dim dimension

    spilt one tensor into multi tensor along the dim dimension

    dim

    the specific dimension

  154. abstract def split(size: Int, dim: Int = 1): Array[Tensor[T]]

    Permalink

    Splits current tensor along dimension dim into a result table of Tensors of size size (a number) or less (in the case of the last Tensor).

    Splits current tensor along dimension dim into a result table of Tensors of size size (a number) or less (in the case of the last Tensor). The sizes of the non-dim dimensions remain unchanged. Internally, a series of narrows are performed along dimensions dim. Argument dim defaults to 1.

  155. abstract def sqrt(y: Tensor[T]): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  156. abstract def sqrt(): Tensor[T]

    Permalink

    replaces all elements in-place with the square root of the elements of this.

    replaces all elements in-place with the square root of the elements of this.

    Definition Classes
    TensorMath
  157. abstract def square(): Tensor[T]

    Permalink

    Replaces all elements in-place with the elements of x squared

    Replaces all elements in-place with the elements of x squared

    returns

    current tensor reference

    Definition Classes
    TensorMath
  158. abstract def squeeze(dim: Int): Tensor[T]

    Permalink

    Removes given dimensions of the tensor if it's singleton

    Removes given dimensions of the tensor if it's singleton

    returns

    current tensor

  159. abstract def squeeze(): Tensor[T]

    Permalink

    Removes all singleton dimensions of the tensor

    Removes all singleton dimensions of the tensor

    returns

    current tensor

  160. abstract def squeezeNewTensor(): Tensor[T]

    Permalink

    Create a new tensor that removes all singleton dimensions of the tensor

    Create a new tensor that removes all singleton dimensions of the tensor

    returns

    create a new tensor

  161. abstract def storage(): Storage[T]

    Permalink

    Get the storage

    Get the storage

    returns

    storage

  162. abstract def storageOffset(): Int

    Permalink

    tensor offset on the storage

    tensor offset on the storage

    returns

    storage offset, count from 1

  163. abstract def stride(dim: Int): Int

    Permalink

    Jumps between elements on the given dimension in the storage.

    Jumps between elements on the given dimension in the storage.

    dim

    dimension, count from 1

    returns

    jump

  164. abstract def stride(): Array[Int]

    Permalink

    Jumps between elements on the each dimension in the storage.

    Jumps between elements on the each dimension in the storage. It will generate a new array each time method is invoked.

    returns

    strides array

  165. abstract def sub(value: T): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  166. abstract def sub(x: Tensor[T], y: Tensor[T]): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  167. abstract def sub(y: Tensor[T]): Tensor[T]

    Permalink

    subtracts all elements of y from this

    subtracts all elements of y from this

    y

    other tensor

    returns

    current tensor

    Definition Classes
    TensorMath
  168. abstract def sub(x: Tensor[T], value: T, y: Tensor[T]): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  169. abstract def sub(value: T, y: Tensor[T]): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  170. abstract def sum(x: Tensor[T], dim: Int): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  171. abstract def sum(dim: Int): Tensor[T]

    Permalink

    performs the sum operation over the dimension dim

    performs the sum operation over the dimension dim

    Definition Classes
    TensorMath
  172. abstract def sum(): T

    Permalink

    returns the sum of the elements of this

    returns the sum of the elements of this

    Definition Classes
    TensorMath
  173. abstract def sumSquare(): T

    Permalink
    Definition Classes
    TensorMath
  174. abstract def t(): Tensor[T]

    Permalink

    Shortcut of transpose(1, 2) for 2D tensor

    Shortcut of transpose(1, 2) for 2D tensor

    See also

    transpose()

  175. abstract def tanh(y: Tensor[T]): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  176. abstract def tanh(): Tensor[T]

    Permalink

    replaces all elements in-place with the tanh root of the elements of this.

    replaces all elements in-place with the tanh root of the elements of this.

    Definition Classes
    TensorMath
  177. abstract def toArray(): Array[T]

    Permalink

    Convert 1D tensor to an array.

    Convert 1D tensor to an array. If the tensor is not 1D, an exception will be thrown out.

  178. abstract def toBreezeMatrix(): DenseMatrix[T]

    Permalink

    convert the tensor to BreezeMatrix, the dimension of the tensor need to be 2.

    convert the tensor to BreezeMatrix, the dimension of the tensor need to be 2.

    returns

    BrzDenseMatrix

  179. abstract def toBreezeVector(): DenseVector[T]

    Permalink

    convert the tensor to BreezeVector, the dimension of the tensor need to be 1.

    convert the tensor to BreezeVector, the dimension of the tensor need to be 1.

    returns

    BrzDenseVector

  180. abstract def toMLlibMatrix(): Matrix

    Permalink

    convert the tensor to MLlibMatrix, the dimension of the tensor need to be 2, and tensor need to be continuous.

    convert the tensor to MLlibMatrix, the dimension of the tensor need to be 2, and tensor need to be continuous.

    returns

    Matrix

  181. abstract def toMLlibVector(): Vector

    Permalink

    convert the tensor to MLlibVector, the dimension of the tensor need to be 1, and tensor need to be continuous.

    convert the tensor to MLlibVector, the dimension of the tensor need to be 1, and tensor need to be continuous.

    returns

    Vector

  182. abstract def toTensor[D](implicit ev: TensorNumeric[D]): Tensor[D]

    Permalink
    Definition Classes
    Activity
  183. abstract def topk(k: Int, dim: Int = 1, increase: Boolean = true, result: Tensor[T] = null, indices: Tensor[T] = null, sortedResult: Boolean = true): (Tensor[T], Tensor[T])

    Permalink

    Get the top k smallest values and their indices.

    Get the top k smallest values and their indices.

    dim

    dimension, default is the last dimension

    increase

    sort order, set it to true if you want to get the smallest top k values

    result

    result buffer

    indices

    indices buffer

    Definition Classes
    TensorMath
  184. abstract def transpose(dim1: Int, dim2: Int): Tensor[T]

    Permalink

    * Create a new tensor which exchanges the given dimensions of the current tensor

    * Create a new tensor which exchanges the given dimensions of the current tensor

    dim1

    dimension to be exchanged, count from one

    dim2

    dimension to be exchanged, count from one

    returns

    new tensor

  185. abstract def unary_-(): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  186. abstract def unfold(dim: Int, size: Int, step: Int): Tensor[T]

    Permalink

    Returns a tensor which contains all slices of size @param size in the dimension @param dim.

    Returns a tensor which contains all slices of size @param size in the dimension @param dim. Step between two slices is given by @param step.

    step

    Step between two slices

    returns

    new tensor

  187. abstract def uniform(args: T*): T

    Permalink

    return pseudo-random numbers, require 0<=args.length<=2 if args.length = 0, return [0, 1) if args.length = 1, return [1, args(0)] or [args(0), 1] if args.length = 2, return [args(0), args(1)]

    return pseudo-random numbers, require 0<=args.length<=2 if args.length = 0, return [0, 1) if args.length = 1, return [1, args(0)] or [args(0), 1] if args.length = 2, return [args(0), args(1)]

    Definition Classes
    TensorMath
  188. abstract def update(filter: (T) ⇒ Boolean, value: T): Unit

    Permalink

    Update the value meeting the filter criteria with the give value

    Update the value meeting the filter criteria with the give value

    filter

    filter

    value

    value to update

  189. abstract def update(t: Table, src: Tensor[T]): Unit

    Permalink

    Copy the given tensor values to the selected subset of the current tensor Each element of the given table can be an Int or another Table.

    Copy the given tensor values to the selected subset of the current tensor Each element of the given table can be an Int or another Table. An Int means select on current dimension; A table means narrow on current dimension, the table should has two elements, of which the first is start index and the second is the end index. An empty table is equal to Table(1, size_of_current_dimension). If the table's length is smaller than the tensor's dimension, the missing dimension is applied by an empty table.

    t

    subset table

    src

    tensor to copy

  190. abstract def update(t: Table, value: T): Unit

    Permalink

    Fill the select subset of the current tensor with the given value.

    Fill the select subset of the current tensor with the given value. The element of the given table can be an Int or another Table. An Int means select on current dimension; A table means narrow on the current dimension, the table should has two elements, of which the first is the start index and the second is the end index. An empty table is equal to Table(1, size_of_current_dimension) If the table length is less than the tensor dimension, each missing dimension is applied by an empty table

    t

    subset table

    value

    value to write

  191. abstract def update(indexes: Array[Int], value: T): Unit

    Permalink

    Write the value to the positions indexed by the given index array

    Write the value to the positions indexed by the given index array

    indexes

    index array. It should has same length with the tensor dimension

    value

    value to write

  192. abstract def update(index: Int, src: Tensor[T]): Unit

    Permalink

    Copy the give tensor value to the select subset of the current tensor by the given index.

    Copy the give tensor value to the select subset of the current tensor by the given index. The subset should have the same size of the given tensor

    index

    index

    src

    tensor to write

  193. abstract def update(index: Int, value: T): Unit

    Permalink

    For tensor(i) = value.

    For tensor(i) = value. If tensor(i) is another tensor, it will fill the selected subset by the given value

    index

    index

    value

    value to write

  194. abstract def value(): T

    Permalink

    returns

    the value of a scalar. Requires the tensor to be a scalar.

  195. abstract def valueAt(d1: Int, d2: Int, d3: Int, d4: Int, d5: Int): T

    Permalink
  196. abstract def valueAt(d1: Int, d2: Int, d3: Int, d4: Int): T

    Permalink
  197. abstract def valueAt(d1: Int, d2: Int, d3: Int): T

    Permalink
  198. abstract def valueAt(d1: Int, d2: Int): T

    Permalink
  199. abstract def valueAt(d1: Int): T

    Permalink

    Query the value on a given position.

    Query the value on a given position. The number of parameters should be equal to the dimension number of the tensor. Tensor should not be empty.

    returns

    the value on a given position

  200. abstract def view(sizes: Array[Int]): Tensor[T]

    Permalink
  201. abstract def xcorr2(kernel: Tensor[T], vf: Char = 'V'): Tensor[T]

    Permalink

    This function operates with same options and input/output configurations as conv2, but performs cross-correlation of the input with the kernel k.

    This function operates with same options and input/output configurations as conv2, but performs cross-correlation of the input with the kernel k.

    vf

    full ('F') or valid ('V') convolution.

    Definition Classes
    TensorMath
  202. abstract def zero(): Tensor[T]

    Permalink

    Fill with zero.

    Fill with zero. It will change the value of the current tensor and return itself

    returns

    current tensor

  203. abstract def zipWith[A, B](t1: Tensor[A], t2: Tensor[B], func: (A, B) ⇒ T)(implicit arg0: ClassTag[A], arg1: ClassTag[B]): Tensor[T]

    Permalink

    Zip values of two other tensors with applying the function func on each two values element-wisely and assign the result value to the current tensor

    Zip values of two other tensors with applying the function func on each two values element-wisely and assign the result value to the current tensor

    The two given tensors should has the same size of the current tensor

    A

    numeric type of tensor 1

    B

    numeric type of tensor 2

    t1

    tensor 1

    t2

    tensor 2

    func

    zip with the function

    returns

    self

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(e: Either[Tensor[T], T]): Tensor[T]

    Permalink
    Definition Classes
    TensorMath
  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  5. def almostEqual(other: Tensor[T], delta: Double): Boolean

    Permalink

    Compare with other tensor.

    Compare with other tensor. The shape of the other tensor must be same with this tensor. If element wise difference is less than delta, return true.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): Tensor[T]

    Permalink

    Get a new tensor with same value and different storage

    Get a new tensor with same value and different storage

    returns

    new tensor

    Definition Classes
    Tensor → AnyRef
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. def isTable: Boolean

    Permalink

    Return false because it's not a Table

    Return false because it's not a Table

    returns

    false

    Definition Classes
    TensorActivity
  15. def isTensor: Boolean

    Permalink

    Return true because it's a Tensor implemented from Activity

    Return true because it's a Tensor implemented from Activity

    returns

    true

    Definition Classes
    TensorActivity
  16. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def notEqualValue(value: Double): Boolean

    Permalink

    Element wise inequality between tensor and given value

  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. def numNonZeroByRow(): Array[Int]

    Permalink

    Count the number of non-zero elements in first dimension.

    Count the number of non-zero elements in first dimension. For SparseTensor only.

    returns

    an array number of non-zero elements in first dimension.

  21. def resize(sizes: Array[Int], nElement: Int): Tensor[T]

    Permalink
  22. def shallowClone(): Tensor[T]

    Permalink

    Get a new tensor with same storage.

    Get a new tensor with same storage.

    returns

    new tensor

  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  24. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  25. def toTable: Table

    Permalink
    Definition Classes
    TensorActivity
  26. def view(sizes: Int*): Tensor[T]

    Permalink

    Return a new tensor with specified sizes.

    Return a new tensor with specified sizes. The input tensor must be contiguous, and the elements number in the given sizes must be equal to the current tensor

    returns

    new tensor

  27. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Activity

Inherited from TensorMath[T]

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped