code: def test_no_cropping_shape(self):
      input_param = {"spatial_axis": 0, "do_cropping": False}
      expected_shape = (2, 14, 16, 16, 8)
      expected_value = np.zeros(expected_shape)
      self._test_nd_gradient_output_shape(
          rank=3,
          param_dict=input_param,
          expected_shape=expected_shape,
          expected_value=expected_value,
      )
  
      input_param = {"spatial_axis": 0, "do_cropping": False}
      expected_shape = (2, 14, 16, 8)
      expected_value = np.zeros(expected_shape)
      self._test_nd_gradient_output_shape(
          rank=2,
          param_dict=input_param,
          expected_shape=expected_shape,
          expected_value=expected_value,
      )
  
      input_param = {"spatial_axis": 1, "do_cropping": False}
      expected_shape = (2, 16, 14, 16, 8)
      expected_value = np.zeros(expected_shape)
      self._test_nd_gradient_output_shape(
          rank=3,
          param_dict=input_param,
          expected_shape=expected_shape,
          expected_value=expected_value,
      )
  
      input_param = {"spatial_axis": 1, "do_cropping": False}
      expected_shape = (2, 16, 14, 8)
      expected_value = np.zeros(expected_shape)
      self._test_nd_gradient_output_shape(
          rank=2,
          param_dict=input_param,
          expected_shape=expected_shape,
          expected_value=expected_value,
      )
  
      input_param = {"spatial_axis": 2, "do_cropping": False}
      expected_shape = (2, 16, 16, 14, 8)
      expected_value = np.zeros(expected_shape)
      self._test_nd_gradient_output_shape(
          rank=3,
          param_dict=input_param,
          expected_shape=expected_shape,
          expected_value=expected_value,
      )
  
      input_param = {"spatial_axis": -1, "do_cropping": False}
      self._test_nd_gradient_output_shape(
          rank=3,
          param_dict=input_param,
          expected_shape=expected_shape,
          expected_value=expected_value,
      )
  
file_path: NiftyNet/tests/spatial_gradient_test.py
imports: from __future__ import absolute_import, print_function
  import numpy
  import tensorflow
  from niftynet.layer.spatial_gradient import SpatialGradientLayer
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 5 for calling the SpatialGradientTest obj's underlying member method code with example usage: obj.test_no_cropping_shape() without return types