powered by
Given a mode for a K-tensor, this returns the K-1 tensor resulting from summing across that particular mode.
modeSum(tnsr, m, drop)# S4 method for Tensor modeSum(tnsr, m = NULL, drop = FALSE)
# S4 method for Tensor modeSum(tnsr, m = NULL, drop = FALSE)
the Tensor instance
the index of the mode to sum across
whether or not mode m should be dropped
K-1 or K tensor, where K = x@num_modes
K = x@num_modes
modeSum(tnsr,m=NULL,drop=FALSE)
modeMean
# NOT RUN { tnsr <- rand_tensor() modeSum(tnsr,3,drop=TRUE) # }
Run the code above in your browser using DataLab