Checks if two tensors are equal.