code: def test_3d_linear_partial_shapes(self):
      test_grid = tf.constant(
          [
              [[0.25, 0.25, 0.25], [0.25, 0.75, 0.25]],
              [[0.75, 0.25, 0.25], [0.25, 0.25, 0.75]],
          ],
          dtype=tf.float32,
      )
      expected = [
          [[2.75, 102.75], [3.75, 103.75]],
          [[12.75, 112.75], [11.25, 111.25]],
      ]
      interp = "linear"
  
      from niftynet.layer.resampler import SUPPORTED_BOUNDARY
  
      for b in list(SUPPORTED_BOUNDARY):
          self._test_partial_shape_correctness(
              input=self.get_3d_input2(False),
              rank=3,
              batch_size=2,
              grid=test_grid,
              interpolation=interp,
              boundary=b,
              expected_value=expected,
          )
  
          with self.assertRaisesRegexp(TypeError, "shape"):
              self._test_partial_shape_correctness(
                  input=self.get_3d_input2(False),
                  rank=3,
                  batch_size=-1,
                  grid=test_grid,
                  interpolation=interp,
                  boundary=b,
                  expected_value=None,
              )
  
          with self.assertRaisesRegexp(TypeError, "shape"):
              self._test_partial_shape_correctness(
                  input=self.get_3d_input2(False),
                  rank=-1,
                  batch_size=-1,
                  grid=test_grid,
                  interpolation=interp,
                  boundary=b,
                  expected_value=None,
              )
  
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import tensorflow
  from niftynet.layer.resampler import ResamplerLayer
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 21 for calling the ResamplerTest obj's underlying member method code with example usage: obj.test_3d_linear_partial_shapes() without return types