code: def test_value_shape(self, input_param, img, out, expected_shape):
      result = AsDiscrete(**input_param)(img)
      assert_allclose(result, out, rtol=1e-3, type_test="tensor")
      self.assertTupleEqual(result.shape, expected_shape)
  
file_path: MONAI/tests/test_as_discrete.py
imports: from __future__ import annotations
  import unittest
  from parameterized import parameterized
  from monai.transforms import AsDiscrete
  from tests.utils import TEST_NDARRAYS, assert_allclose
label_desc: Use image node_id 1 for calling the TestAsDiscrete obj's underlying member method code with example usage: obj.test_value_shape(input_param, img, out, expected_shape) without return types