code: def mask_for_shape(shape, pad_mask: Optional[jnp.ndarray] = None):
      """Create boolean mask by resizing from given mask or set all True."""
      bs, h, w, _ = shape
      if pad_mask is None:
          resized_pad_mask = jnp.ones((bs, h, w), dtype=jnp.bool_)
      else:
          resized_pad_mask = jax.image.resize(
              pad_mask.astype(jnp.float32),
              shape=[bs, h, w],
              method="nearest",
          ).astype(jnp.bool_)
      return resized_pad_mask
  
file_path: scenic/scenic/projects/baselines/deformable_detr/backbone.py
imports: from typing import List, Optional, Sequence
  import flax.linen
  import jax
  import jax.numpy
  from scenic.projects.baselines import resnet
label_desc: Use image node_id 1 for calling a global function with example usage: mask_for_shape(shape, pad_mask) and returns: resized_pad_mask