Calculates the reciprocal of a tensor.