code: def _create_octave_mask(
      mask: Tensor, octave_shape: List[int]
  ) -> Tensor:
      r"""Downsample a mask based on the given octave shape."""
      mask_shape = octave_shape[-2:]
      mask_octave = F.interpolate(
          mask, mask_shape, mode="bilinear", align_corners=False
      )
      return mask_octave.unsqueeze(1)
  
imports: import math
  from typing import List, Optional, Tuple
  import torch
  import torch.nn.functional
  from typing_extensions import TypedDict
  from kornia.core import Device, Module, Tensor, concatenate, eye, tensor, where, zeros
  from kornia.core.check import KORNIA_CHECK_SHAPE
  from kornia.geometry.subpix import ConvSoftArgmax3d, NonMaximaSuppression2d
  from kornia.geometry.transform import ScalePyramid, pyrdown, resize
  from .laf import laf_from_center_scale_ori, laf_is_inside_image
  from .orientation import PassLAF
  from .responses import BlobHessian
label_desc: Use image node_id 2 for calling a global function with example usage: _create_octave_mask(mask, octave_shape) and returns: mask_octave