code: def test_round_trip(m):
      assert_equal_tensor_ref(m.round_trip_tensor(tensor_ref))
  
      with pytest.raises(
          TypeError, match="^Cannot cast array data from"
      ):
          assert_equal_tensor_ref(m.round_trip_tensor2(tensor_ref))
  
      assert_equal_tensor_ref(
          m.round_trip_tensor2(np.array(tensor_ref, dtype=np.int32))
      )
      assert_equal_tensor_ref(m.round_trip_fixed_tensor(tensor_ref))
      assert_equal_tensor_ref(
          m.round_trip_aligned_view_tensor(m.reference_tensor())
      )
  
      copy = np.array(
          tensor_ref, dtype=np.float64, order=m.needed_options
      )
      assert_equal_tensor_ref(m.round_trip_view_tensor(copy))
      assert_equal_tensor_ref(m.round_trip_view_tensor_ref(copy))
      assert_equal_tensor_ref(m.round_trip_view_tensor_ptr(copy))
      copy.setflags(write=False)
      assert_equal_tensor_ref(m.round_trip_const_view_tensor(copy))
  
      np.testing.assert_array_equal(
          tensor_ref[:, ::-1, :],
          m.round_trip_tensor(tensor_ref[:, ::-1, :]),
      )
  
      assert m.round_trip_rank_0(np.float64(3.5)) == 3.5
      assert m.round_trip_rank_0(3.5) == 3.5
  
      with pytest.raises(
          TypeError,
          match=r"^round_trip_rank_0_noconvert\(\): incompatible function arguments",
      ):
          m.round_trip_rank_0_noconvert(np.float64(3.5))
  
      with pytest.raises(
          TypeError,
          match=r"^round_trip_rank_0_noconvert\(\): incompatible function arguments",
      ):
          m.round_trip_rank_0_noconvert(3.5)
  
      with pytest.raises(
          TypeError,
          match=r"^round_trip_rank_0_view\(\): incompatible function arguments",
      ):
          m.round_trip_rank_0_view(np.float64(3.5))
  
      with pytest.raises(
          TypeError,
          match=r"^round_trip_rank_0_view\(\): incompatible function arguments",
      ):
          m.round_trip_rank_0_view(3.5)
  
file_path: coremltools/deps/pybind11/tests/test_eigen_tensor.py
imports: import sys
  import pytest
label_desc: Use image node_id 9 for calling a global function with example usage: test_round_trip(m) without return types