
Last chance! 50% off unlimited learning
Sale ends in
Applies a reduction to a LazyTensor
.
reduction.LazyTensor(x, opstr, index, opt_arg = NULL)
an array storing the result of the specified reduction.
a LazyTensor
or a ComplexLazyTensor
.
a string
formula (like "Sum" or "Max").
a character
corresponding to the wanted reduction dimension,
either "i"
or "j"
, to specify whether if the reduction is done along
the index i
or j
.
an optional argument: an integer
(e.g. for Kmin
reduction), a character
, a LazyTensor
or a ComplexLazyTensor
. NULL
if not used (default).
Chloe Serre-Combe, Amelie Vernay
reduction.LazyTensor(x, opstr, index)
will :
if index = "i"
, return the opstr
reduction of x
over the "i" indexes;
if index = "j"
, return the opstr
reduction of x
over the "j" indexes.
if (FALSE) {
x <- matrix(runif(150 * 3), 150, 3) # arbitrary R matrix, 150 rows, 3 columns
x_i <- LazyTensor(x, index = 'i') # creating LazyTensor from matrix x,
# indexed by 'i'
red_x <- reduction.LazyTensor(x_i, "Sum", "i")
}
Run the code above in your browser using DataLab