I think you could achieve this by using torch.unfold on the last dimension and perform your operations using the python’s map function. You would need to the concatenate the output of the mapping.
funcs = [torch.cos, torch.sin, torch.tan, torch.log]
x = torch.tensor(np.arange(20).astype('f')).view(4,5)
xu = torch.unbind(x, dim=0)
torch.stack([funcs[i](x) for i, x in enumerate(xu)], dim=0)

If you have some functions that need more than one arguments, you could always wrap them up inside lambda functions (Not always the best thing to do), but that depends on what kinds of functions you’re going to be using.