code: def sobel(
      input: Tensor, normalized: bool = True, eps: float = 1e-6
  ) -> Tensor:
      r"""Compute the Sobel operator and returns the magnitude per channel.
  
      .. image:: _static/img/sobel.png
  
      Args:
          input: the input image with shape :math:`(B,C,H,W)`.
          normalized: if True, L1 norm of the kernel is set to 1.
          eps: regularization number to avoid NaN during backprop.
  
      Return:
          the sobel edge gradient magnitudes map with shape :math:`(B,C,H,W)`.
  
      .. note::
         See a working example `here <https://kornia.github.io/tutorials/nbs/filtering_edges.html>`__.
  
      Example:
          >>> input = torch.rand(1, 3, 4, 4)
          >>> output = sobel(input)  # 1x3x4x4
          >>> output.shape
          torch.Size([1, 3, 4, 4])
      """
      KORNIA_CHECK_IS_TENSOR(input)
      KORNIA_CHECK_SHAPE(input, ["B", "C", "H", "W"])
  
      # comput the x/y gradients
      edges: Tensor = spatial_gradient(input, normalized=normalized)
  
      # unpack the edges
      gx: Tensor = edges[:, :, 0]
      gy: Tensor = edges[:, :, 1]
  
      # compute gradient maginitude
      magnitude: Tensor = torch.sqrt(gx * gx + gy * gy + eps)
  
      return magnitude
  
imports: from __future__ import annotations
  import torch
  import torch.nn.functional
  from kornia.core import Module, Tensor, pad
  from kornia.core.check import KORNIA_CHECK_IS_TENSOR, KORNIA_CHECK_SHAPE
  from .kernels import get_spatial_gradient_kernel2d, get_spatial_gradient_kernel3d, normalize_kernel2d
label_desc: Use image node_id 3 for calling a global function with example usage: sobel(input, normalized, eps) and returns: magnitude