code: def _is_box_near_crop_edge_tf(boxes, crop_box, orig_box, atol=20.0):
      """Filter masks at the edge of a crop, but not at the edge of the original image."""
      crop_box_tf = tf.convert_to_tensor(crop_box, dtype=tf.float32)
      orig_box_tf = tf.convert_to_tensor(orig_box, dtype=tf.float32)
  
      left, top, _, _ = crop_box
      offset = tf.convert_to_tensor([[left, top, left, top]])
      # Check if boxes has a channel dimension
      if len(boxes.shape) == 3:
          offset = tf.expand_dims(offset, 1)
      boxes = tf.cast(boxes + offset, tf.float32)
  
      near_crop_edge = tnp.isclose(
          boxes, crop_box_tf[None, :], atol=atol, rtol=0
      )
      near_image_edge = tnp.isclose(
          boxes, orig_box_tf[None, :], atol=atol, rtol=0
      )
      near_crop_edge = tf.math.logical_and(
          near_crop_edge, ~near_image_edge
      )
      return tf.reduce_any(near_crop_edge, axis=1)
  
imports: import math
  from copy import deepcopy
  from itertools import product
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
  from ...image_transforms import convert_to_rgb, pad, resize, to_channel_dimension_format
  from ...image_utils import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, ChannelDimension, ImageInput, PILImageResampling, get_image_size, infer_channel_dimension_format, is_scaled_image, make_list_of_images, to_numpy_array, valid_images
  from ...utils import TensorType, is_tf_available, is_torch_available, is_torchvision_available, logging, requires_backends
label_desc: Use image node_id 11 for calling a global function with example usage: _is_box_near_crop_edge_tf(boxes, crop_box, orig_box, atol) and returns: tf