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