code: def _boundary_replicate(sample_coords, input_size):
      sample_coords, input_size = _param_type_and_shape(
          sample_coords, input_size
      )
      return tf.maximum(tf.minimum(sample_coords, input_size - 1), 0)
  
file_path: NiftyNet/niftynet/layer/resampler.py
imports: from __future__ import absolute_import, division, print_function
  import tensorflow
  from niftynet.layer.base_layer import Layer
  from niftynet.layer.layer_util import infer_spatial_rank
  from niftynet.utilities.util_common import look_up_operations
label_desc: Use image node_id 1 for calling a global function with example usage: _boundary_replicate(sample_coords, input_size) and returns: tf