These functions apply a function to each element of the tensor on which the method is called (self). These methods are much faster than using a for loop in Lua. The results is stored in self (if the function returns something). A similar function exists in the lab package, but where a new tensor containing the result is returned instead.

Subsections

  1. [self] apply(function(x))
  2. [self] map(tensor, function(xs, xt))
  3. [self] map2(tensor1, tensor2, function(x, xt1, xt2))