code: def test_nonunit_stride_from_python():
      from pybind11_tests import (
          double_row,
          double_col,
          double_mat_cm,
          double_mat_rm,
      )
  
      counting_mat = np.arange(9.0, dtype=np.float32).reshape((3, 3))
      first_row = counting_mat[0, :]
      first_col = counting_mat[:, 0]
      assert np.array_equal(double_row(first_row), 2.0 * first_row)
      assert np.array_equal(double_col(first_row), 2.0 * first_row)
      assert np.array_equal(double_row(first_col), 2.0 * first_col)
      assert np.array_equal(double_col(first_col), 2.0 * first_col)
  
      counting_3d = np.arange(27.0, dtype=np.float32).reshape((3, 3, 3))
      slices = [
          counting_3d[0, :, :],
          counting_3d[:, 0, :],
          counting_3d[:, :, 0],
      ]
      for slice_idx, ref_mat in enumerate(slices):
          assert np.array_equal(double_mat_cm(ref_mat), 2.0 * ref_mat)
          assert np.array_equal(double_mat_rm(ref_mat), 2.0 * ref_mat)
  
file_path: coremltools/deps/pybind11/tests/test_eigen.py
imports: import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: test_nonunit_stride_from_python() without return types