Visit-function, applies the supplied lambda func to the currently active tensor and returns the result.
func
References tensor.