code: def test_einsum_all_contig_non_contig_output(self):
      # Issue gh-5907, tests that the all contiguous special case
      # actually checks the contiguity of the output
      x = np.ones((5, 5))
      out = np.ones(10)[::2]
      correct_base = np.ones(10)
      correct_base[::2] = 5
      # Always worked (inner iteration is done with 0-stride):
      np.einsum("mi,mi,mi->m", x, x, x, out=out)
      assert_array_equal(out.base, correct_base)
      # Example 1:
      out = np.ones(10)[::2]
      np.einsum("im,im,im->m", x, x, x, out=out)
      assert_array_equal(out.base, correct_base)
      # Example 2, buffering causes x to be contiguous but
      # special cases do not catch the operation before:
      out = np.ones((2, 2, 2))[..., 0]
      correct_base = np.ones((2, 2, 2))
      correct_base[..., 0] = 2
      x = np.ones((2, 2), np.float32)
      np.einsum("ij,jk->ik", x, x, out=out)
      assert_array_equal(out.base, correct_base)
  
imports: import itertools
  import sys
  import platform
  import pytest
  import numpy
  from numpy.testing import assert_, assert_equal, assert_array_equal, assert_almost_equal, assert_raises, suppress_warnings, assert_raises_regex, assert_allclose
label_desc: Use image node_id 28 for calling the TestEinsum obj's underlying member method code with example usage: obj.test_einsum_all_contig_non_contig_output() without return types