package ops

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. class All[T] extends Operation[Table, Tensor[Boolean], T]
  2. class Any[T] extends Operation[Table, Tensor[Boolean], T]
  3. class ApproximateEqual[T] extends Compare[T]
  4. class ArgMax[T] extends Operation[Table, Tensor[Int], T]
  5. class BatchMatMul[T, D] extends Operation[Table, Tensor[D], T]

    Multiplies all slices of Tensor x and y (each slice can be viewed as an element of a batch), and arranges the individual results in a single output tensor of the same batch size.

    Multiplies all slices of Tensor x and y (each slice can be viewed as an element of a batch), and arranges the individual results in a single output tensor of the same batch size. Each of the individual slices can optionally be adjointed (to adjoint a matrix means to transpose and conjugate it) before multiplication by setting the adj_x or adj_y flag to True, which are by default False.

  6. class BucketizedCol[T] extends Operation[Tensor[T], Tensor[Int], T]

    BucketizedCol operation represents discretized dense input.

    BucketizedCol operation represents discretized dense input.

    The Operation can handle single or multi feature column, as long as the boundaries is same between feature columns.

    Buckets include the left boundary, and exclude the right boundary. Namely, boundaries=Array(0, 1, 10) generates buckets (-inf,0),[0,1),[1,10),[10,+inf)

    For example, boundaries = Array(0, 10, 100) and input tensor is an 2D 3x2 DenseTensor: -1, 1 101, 10 5, 100

    the output tensor should be an 2D 3x2 DenseTensor 0, 1 3, 2 1, 3

    T

    Numeric type. Parameter tensor numeric type. Only support float/double now

  7. class Cast[T, D] extends Operation[Tensor[_], Tensor[D], T]

    Casts a tensor to a new type.

    Casts a tensor to a new type.

    T

    Parameter tensor numeric type. Only support float/double now

    D

    A new type was cast to

  8. class CategoricalColHashBucket[T] extends Operation[Tensor[String], Tensor[Int], T]

    CategoricalColHashBucket operation can convert feature string to a Sparse/Dense Tensor

    CategoricalColHashBucket operation can convert feature string to a Sparse/Dense Tensor

    SparseTensor if isSparse = true DenseTensor if isSparse = false

    the input is a Tensor[String] with shape batch * 1.

    This operation distributes your inputs into a finite number of buckets by hashing

    The Operation support the feature column with single-value or multi-value

    The output_id = Hash(input_feature_string) % hashBucketSize, ranging 0 to hashBucketSize-1

    The missing values in input Tensor can be represented by -1 for int and ' for string

    T

    Numeric type. Parameter tensor numeric type. Only support float/double now

  9. class CategoricalColVocaList[T] extends Operation[Tensor[String], Tensor[Int], T]

    CategoricalColVocaList operation having an vocabulary mapping feature string to Integer ID

    CategoricalColVocaList operation having an vocabulary mapping feature string to Integer ID

    By default, out-of-vocabulary values are ignored. Use either (but not both) of num_oov_buckets and default_value to specify how to include out-of-vocabulary values.

    if isSetDefault=false && num_oov_buckets=0 the out-of-vocabulary values will be filtered. if isSetDefault enabled, the defalut value len(vocabulary_list) will be set. if num_oov_buckets enabled, all out-of-vocabulary inputs will be assigned IDs in the range [len(vocabulary_list), len(vocabulary_list)+num_oov_buckets) based on a hash of the input value

    A positive num_oov_buckets can not be specified with default_value.

    the input Tensor[String] can be 1-D or 2-D Tensor.

    The Operation support the feature column with single-value or multi-value

    The missing values in input Tensor can be represented by -1 for int and ' for string

    T

    Numeric type. Parameter tensor numeric type. Only support float/double now

  10. class Ceil[T, D] extends Operation[Tensor[D], Tensor[D], T]
  11. abstract class Compare[T] extends Operation[Table, Tensor[Boolean], T]
  12. class CrossCol[T] extends Operation[Table, Tensor[Int], T]

    CrossCol operation preforms crosses of categorical features.

    CrossCol operation preforms crosses of categorical features.

    The transformation can be thought of as Hash(cartesian product of features) % hashBucketSize)

    The input Table contains more than or equal to 2 Tensor[String]. Each Tensor[String] represents a categorical feature column. Each row in Tensor[String] represents the string of value, which supports single-value and multi-value joined by strDelimiter.

    As for the SparseTensor, it should be transformed to Tensor[String] before feeding into the Operation

    For example, if the two input tensors with size=3 are: "A,D", "B", "A,C" "1", "2", "3,4"

    the output tensor should be an 2D 3 x maxLength SparseTensor: [0, 0]: Hash32("1", Hash32("D")) % hashBucketSize [0, 1]: Hash32("1", Hash32("A")) % hashBucketSize [1, 0]: Hash32("2", Hash32("B")) % hashBucketSize [2, 0]: Hash32("3", Hash32("C")) % hashBucketSize [2, 1]: Hash32("4", Hash32("C")) % hashBucketSize [2, 2]: Hash32("3", Hash32("A")) % hashBucketSize [2, 3]: Hash32("4", Hash32("A")) % hashBucketSize

    T

    Numeric type. Parameter tensor numeric type. Only support float/double now

  13. class CrossEntropy[T] extends Operation[Table, Table, T]

    Compute the cross entropy loss and the gradients.

    Compute the cross entropy loss and the gradients.

    T

    Numeric type. Only support float/double now

  14. class DepthwiseConv2D[T] extends Operation[Table, Tensor[T], T]
  15. class Digamma[T, D] extends Operation[Tensor[D], Tensor[D], T]
  16. class Dilation2D[T, D] extends Operation[Table, Tensor[D], T]

    Computes the grayscale dilation of 4-D input and 3-D filter tensors.

    Computes the grayscale dilation of 4-D input and 3-D filter tensors.

    This layer takes a Table of two tensors as inputs, namely input and filter. The input tensor has shape [batch, in_height, in_width, depth] and the filter tensor has shape [filter_height, filter_width, depth], i.e., each input channel is processed independently of the others with its own structing fucntion. The output tensor has shape [batch, out_height, out_width, depth]. The spatial dimensions of the output tensor depend on the padding algorithm. We currently only support the "NHWC" DataFormat.

    In detail, the grayscale morphological 2-D dilation is the max-sum correlation

    output[b, y, x, c] = max_{dy, dx} input[b, strides[1] * y + rates[1] * dy, strides[2] * x + rates[2] * dx, c] + filter[dy, dx, c]

    Max-pooling is a special case when the filter has size equal to the pooling kernel size and contains all zeros.

    Note on duality: The dilation of input by the filter is equal to the negation of the erosion of -input by the reflected filter.

  17. class Equal[T] extends Compare[T]
  18. class Erf[T, D] extends Operation[Tensor[D], Tensor[D], T]
  19. class Erfc[T, D] extends Operation[Tensor[D], Tensor[D], T]
  20. class Exp[T, D] extends Operation[Tensor[D], Tensor[D], T]
  21. class Expm1[T, D] extends Operation[Tensor[D], Tensor[D], T]
  22. class Floor[T] extends Operation[Tensor[_], Tensor[_], T]
  23. class FloorDiv[T, D] extends Operation[Table, Tensor[D], T]
  24. class FloorMod[T, D] extends Operation[Table, Tensor[D], T]
  25. class Gather[T, D] extends Operation[Table, Tensor[D], T]

    Gather slices from first input tensor according to the second input tensor.

    Gather slices from first input tensor according to the second input tensor. Input should be two tensors, the first one is the tensor which to gather values; the second one is Index tensor.

  26. class Greater[T] extends Compare[T]
  27. class GreaterEqual[T] extends Compare[T]
  28. class InTopK[T] extends Operation[Table, Tensor[Boolean], T]
  29. class IndicatorCol[T] extends Operation[Tensor[Int], Tensor[T], T]

    Indicator operation represents multi-hot representation of given Tensor.

    Indicator operation represents multi-hot representation of given Tensor.

    The Input Tensor should be a 2-D Sparse Tensor. And used to transform the output tensor of CategoricalCol* ops.

    The output tensor should be a DenseTensor with shape (batch, feaLen).

    For example, A input SparseTensor as follows: indices(0) = Array(0, 0, 1, 2, 2) indices(1) = Array(0, 3, 1, 1, 2) values = Array(1, 2, 2, 3, 3) shape = Array(3, 4)

    the output tensor should be an 2D 3x4 DenseTensor with isCount = true 0.0, 1.0, 1.0, 0.0 0.0, 0.0, 1.0, 0.0 0.0, 0.0, 0.0, 2.0

    T

    Numeric type. Parameter tensor numeric type. Only support float/double now

  30. class Inv[T, D] extends Operation[Tensor[D], Tensor[D], T]
  31. class IsFinite[T, D] extends Operation[Tensor[D], Tensor[Boolean], T]
  32. class IsInf[T, D] extends Operation[Tensor[D], Tensor[Boolean], T]
  33. class IsNan[T, D] extends Operation[Tensor[D], Tensor[Boolean], T]
  34. class Kv2Tensor[T, D] extends Operation[Table, Tensor[D], T]

    Kv2Tensor operation convert a kv feature column to a SparseTensor or DenseTensor

    Kv2Tensor operation convert a kv feature column to a SparseTensor or DenseTensor

    DenseTensor if transType = 0 SparseTensor if transType = 1

    The input contains 2 elements which are kvTensor, feaLen: kvTensor shape will be batch*1 and element is a kv string, only support one feature now depth: the length of the value set of the feature

    the output shape will be batch*feaLen if transType = 0 the output shape will be a SparseTensor with dense shape batch*feaLen if transType = 1

    T

    Numeric type. Parameter tensor numeric type. Only support float/double now

    D

    Numeric type. Output tensor numeric type. Only support float/double now

  35. class L2Loss[T] extends Operation[Tensor[_], Tensor[_], T]
  36. class Less[T] extends Compare[T]
  37. class LessEqual[T] extends Compare[T]
  38. class Lgamma[T, D] extends Operation[Tensor[D], Tensor[D], T]
  39. class LogicalAnd[T] extends Operation[Table, Tensor[Boolean], T]
  40. class LogicalNot[T] extends Operation[Tensor[Boolean], Tensor[Boolean], T]
  41. class LogicalOr[T] extends Operation[Table, Tensor[Boolean], T]
  42. class Max[T, D] extends Operation[Table, Tensor[D], T]

    Computes the maximum of elements across dimensions of a tensor.

    Computes the maximum of elements across dimensions of a tensor. The input of Max should be two tensor, the first one is data, the second one is the dimension to compute maximum.

  43. class Maximum[T, D] extends Operation[Table, Tensor[D], T]
  44. class Minimum[T, D] extends Operation[Table, Tensor[D], T]
  45. class MkString[T] extends Operation[Tensor[_], Tensor[String], T]

    MkString operation converts a SparseTensor/DenseTensor to a Dense Tensor[String]

    MkString operation converts a SparseTensor/DenseTensor to a Dense Tensor[String]

    the output shape will be 1-D Tensor[String].

    T

    Numeric type. Parameter tensor numeric type. Only support float/double now

  46. class Mod[T, D] extends Operation[Table, Tensor[D], T]
  47. class ModuleToOperation[T] extends Operation[Activity, Activity, T]

    Wrap a nn module to an Operation

    Wrap a nn module to an Operation

    T

    Numeric type. Only support float/double now

  48. class NotEqual[T] extends Operation[Table, Tensor[Boolean], T]
  49. class OneHot[T, D] extends Operation[Table, Tensor[D], T]

    OneHot operation returns a one-hot tensor

    OneHot operation returns a one-hot tensor

    The input contains 4 elements which are indices, depth, onValue and offValue*[]:

    The locations represented by indices in indices take value onValue, while all other locations take value offValue.

    onValue and offValue must have matching data types. If dtype is also provided, they must be the same data type as specified by D.

    If on_value is not provided, it will default to the value 1 with type dtype

    If off_value is not provided, it will default to the value 0 with type dtype

    If the input indices is rank N, the output will have rank N+1. The new axis is created at dimension axis (default: the new axis is appended at the end).

    If indices is a scalar the output shape will be a vector of length depth

    If indices is a vector of length features, the output shape will be: features x depth if axis == -1 depth x features if axis == 0

    If indices is a matrix (batch) with shape [batch, features], the output shape will be:

    batch x features x depth if axis == -1 batch x depth x features if axis == 1 depth x batch x features if axis == 0

    T

    Numeric type. Parameter tensor numeric type. Only support float/double now

    D

    Numeric type. Output tensor numeric type. Only support float/double now

  50. abstract class Operation[A <: Activity, B <: Activity, T] extends AbstractModule[A, B, T]

    Operation is an abstract class which represents a forward only layer.

    Operation is an abstract class which represents a forward only layer. An operations has only forward functions and without backward functions. An operations should be only used in graph and make sure the backward graph won't contain operations.

    A

    Input data type

    T

    Numeric type. Only support float/double now

  51. class Pad[T, D] extends Operation[Table, Tensor[D], T]
  52. class Pow[T] extends Operation[Table, Tensor[_], T]
  53. class Prod[T] extends Operation[Tensor[_], Tensor[_], T]
  54. class RandomUniform[T, D] extends Operation[Tensor[Int], Tensor[D], T] with RandomNode
  55. class RangeOps[T, D] extends Operation[Table, Tensor[D], T]
  56. class Rank[T] extends Operation[Tensor[_], Tensor[Int], T]
  57. class ResizeBilinearOps[T] extends Operation[Activity, Tensor[T], T]
  58. class Rint[T] extends Operation[Tensor[Float], Tensor[Float], T]
  59. class Round[T, D] extends Operation[Tensor[D], Tensor[D], T]
  60. class SegmentSum[T] extends Operation[Table, Tensor[T], T]

    Computes the sum along segments of a tensor.

  61. class Select[T] extends Operation[Table, Activity, T]

    Selects elements from input, depending on given condition.

    Selects elements from input, depending on given condition. The input is a table (condition, t, e)

    T

    Numeric type. Only support float/double now

  62. class SelectTensor[T] extends Operation[Table, Tensor[T], T]

    Select and copy a Tensor from a Table with a key.

    Select and copy a Tensor from a Table with a key. And do tensor transformation if transformer is defined. If isTensorKey is false, the real key is the value of keyTensor. Otherwise, the real key is keyTensor.

    T

    Numeric type

  63. class Sign[T, D] extends Operation[Tensor[D], Tensor[D], T]
  64. class Slice[T] extends Operation[Tensor[_], Tensor[_], T]

    This operation extracts a slice of size size from a tensor input starting at the location specified by begin.

    This operation extracts a slice of size size from a tensor input starting at the location specified by begin. The slice size is represented as a tensor shape, where size[i] is the number of elements of the 'i'th dimension of input that you want to slice The starting location (begin) for the slice is represented as an offset in each dimension of input. In other words, begin[i] is the offset into the 'i'th dimension of input that you want to slice from.

    T

    Numeric type. Only support float/double now

  65. class SquaredDifference[T] extends Operation[Table, Tensor[_], T]

    Returns (x - y)(x - y) element-wise.

  66. class Substr[T] extends Operation[Table, Tensor[ByteString], T]
  67. class Sum[T, D] extends Operation[Table, Tensor[D], T]
  68. class TensorOp[T] extends Operation[Tensor[T], Tensor[T], T]

    TensorOp is an Operation with Tensor[T]-formatted input and output, which provides shortcuts to build Operations for tensor transformation by closures.

    TensorOp is an Operation with Tensor[T]-formatted input and output, which provides shortcuts to build Operations for tensor transformation by closures.

    TensorOp will make a deep copy of input Tensor before transformation, so transformation will take no side effect. For now, SparseTensors are not supported.

    Chained feature is supported in TensorOp. And common tensor actions are provided with a chained style.

    For instance:

    one case:
       val (transformer1, transformer2, transformer3) = ...
       val (op1, op2, op3) = (TensorOp[Float](transformer1), .., ..)
       val op = op1 -> op2 -> op3
         `equals`
       val op = TensorOp[Float]((t: Tensor[Float], ev: TensorNumeric[Float]) => {
         transformer3(transformer2(transformer1(t, ev), ev), ev)
        })
    
    another case:
       val op = (TensorOp[Float]() * 2.3f + 1.23f) / 1.11f - 0.66f
         `equals`
       val transformer = (t: Tensor[T], _) => t.mul(2.3f).add(1.23f).div(1.11f).sub(0.66f)
       val op = TensorOp[Float](transformer)
    T

    Numeric type

  69. class Tile[T] extends Operation[Table, Tensor[_], T]

    This operation creates a new tensor by replicating input multiples times.

    This operation creates a new tensor by replicating input multiples times. The output tensor's i'th dimension has input.dims(i) * multiples[i] elements, and the values of input are replicated multiples[i] times along the 'i'th dimension.

    For example, tiling [a b c d] by [1, 2] produces [a b c d a b c d].

    T

    Numeric type. Only support float/double now

  70. class TopK[T, D] extends Operation[Tensor[D], Table, T]
  71. class TruncateDiv[T, D] extends Operation[Table, Tensor[D], T]
  72. class TruncatedNormal[T, DataType] extends Operation[Tensor[Int], Tensor[DataType], T]

Value Members

  1. object All extends Serializable
  2. object Any extends Serializable
  3. object ApproximateEqual extends Serializable
  4. object ArgMax extends Serializable
  5. object BatchMatMul extends Serializable
  6. object BucketizedCol extends Serializable
  7. object Cast extends Serializable
  8. object CategoricalColHashBucket extends Serializable
  9. object CategoricalColVocaList extends Serializable
  10. object Ceil extends Serializable
  11. object CrossCol extends Serializable
  12. object CrossEntropy extends Serializable
  13. object DepthwiseConv2D extends Serializable
  14. object Digamma extends Serializable
  15. object Dilation2D extends Serializable
  16. object Equal extends Serializable
  17. object Erf extends Serializable
  18. object Erfc extends Serializable
  19. object Exp extends Serializable
  20. object Expm1 extends Serializable
  21. object Floor extends Serializable
  22. object FloorDiv extends Serializable
  23. object FloorMod extends Serializable
  24. object Gather extends Serializable
  25. object Greater extends Serializable
  26. object GreaterEqual extends Serializable
  27. object InTopK extends Serializable
  28. object IndicatorCol extends Serializable
  29. object Inv extends Serializable
  30. object IsFinite extends Serializable
  31. object IsInf extends Serializable
  32. object IsNan extends Serializable
  33. object Kv2Tensor extends Serializable
  34. object L2Loss extends Serializable
  35. object Less extends Serializable
  36. object LessEqual extends Serializable
  37. object Lgamma extends Serializable
  38. object LogicalAnd extends Serializable
  39. object LogicalNot extends Serializable
  40. object LogicalOr extends Serializable
  41. object Max extends Serializable
  42. object Maximum extends Serializable
  43. object Minimum extends Serializable
  44. object MkString extends Serializable
  45. object Mod extends Serializable
  46. object ModuleToOperation extends Serializable
  47. object NotEqual extends Serializable
  48. object OneHot extends Serializable
  49. object Pad extends Serializable
  50. object Pow extends Serializable
  51. object Prod extends Serializable
  52. object RandomUniform extends ModuleSerializable with Serializable
  53. object RangeOps extends Serializable
  54. object Rank extends Serializable
  55. object ResizeBilinearOps extends Serializable
  56. object Rint extends Serializable
  57. object Round extends Serializable
  58. object SegmentSum extends Serializable
  59. object Select extends Serializable
  60. object SelectTensor extends Serializable
  61. object Sign extends Serializable
  62. object Slice extends Serializable
  63. object SquaredDifference extends Serializable
  64. object Substr extends Serializable
  65. object Sum extends Serializable
  66. object TensorOp extends Serializable
  67. object Tile extends Serializable
  68. object TopK extends Serializable
  69. object TruncateDiv extends Serializable
  70. object TruncatedNormal extends Serializable

Ungrouped