code: def pytorch_error_msg(a, b, rtol, atol):
      msg = f"\ntensor 1\n{a}\ntensor 2\n{b}"
      if torch.is_tensor(a) and torch.is_tensor(b):
          if a.dtype == torch.bool and b.dtype == torch.bool:
              diff = torch.logical_xor(a, b)
              msg = msg + f"\ndifference \n{diff}"
          else:
              diff = torch.abs(a - b)
              msg = (
                  msg
                  + f"\ndifference \n{diff}\nrtol {rtol}\natol {atol}"
              )
      return msg
  
file_path: geomstats/geomstats/test/test_case.py
imports: import inspect
  import numpy
  import pytest
  import geomstats.backend
label_desc: Use image node_id 5 for calling a global function with example usage: pytorch_error_msg(a, b, rtol, atol) and returns: msg