class_docstr: Run a set of generic tests to verify that self.func acts like a
  reduction operation.
  
  Specifically, this class checks axis=... and keepdims=... parameters.
  To check the out=... parameter, see the _GenericHasOutTestMixin class below.
  
  To use: subclass, define self.func and self.allowed_axes.
code: def test_keepdims_out(self, func, axis):
      if func in fails_out_arg:
          raise SkipTest(f"{func.__name__} does not have out= arg.")
      if func in fails_axes_tuples:
          raise SkipTest(f"{func.__name__} does not hangle tuple axis.")
  
      d = np.ones((3, 5, 7, 11))
      if axis is None:
          shape_out = (1,) * d.ndim
      else:
          axis_norm = _util.normalize_axis_tuple(axis, d.ndim)
          shape_out = tuple(
              1 if i in axis_norm else d.shape[i] for i in range(d.ndim)
          )
      out = np.empty(shape_out)
  
      result = func(d, axis=axis, keepdims=True, out=out)
      assert result is out
      assert_equal(result.shape, shape_out)
  
imports: from unittest import skipIf, SkipTest
  import numpy
  import pytest
  from pytest import raises
  from torch.testing._internal.common_utils import instantiate_parametrized_tests, parametrize, run_tests, TEST_WITH_TORCHDYNAMO, TestCase, xpassIfTorchDynamo
label_desc: Use image node_id 10 for calling the TestGenericReductions obj's underlying member method code with example usage: obj.test_keepdims_out(func, axis) without return types