class_docstr: Loss function for HoVerNet pipeline, which is combination of losses across the three branches.
  The NP (nucleus prediction) branch uses Dice + CrossEntropy.
  The HV (Horizontal and Vertical) distance from centroid branch uses MSE + MSE of the gradient.
  The NC (Nuclear Class prediction) branch uses Dice + CrossEntropy
  The result is a weighted sum of these losses.
  
  Args:
      lambda_hv_mse: Weight factor to apply to the HV regression MSE part of the overall loss
      lambda_hv_mse_grad: Weight factor to apply to the MSE of the HV gradient part of the overall loss
      lambda_np_ce: Weight factor to apply to the nuclei prediction CrossEntropyLoss part
          of the overall loss
      lambda_np_dice: Weight factor to apply to the nuclei prediction DiceLoss part of overall loss
      lambda_nc_ce: Weight factor to apply to the nuclei class prediction CrossEntropyLoss part
          of the overall loss
      lambda_nc_dice: Weight factor to apply to the nuclei class prediction DiceLoss part of the
          overall loss
docstr: Compute the Sobel gradients of the horizontal vertical map (HoVerMap).
  More specifically, it will compute horizontal gradient of the input horizontal gradient map (channel=0) and
  vertical gradient of the input vertical gradient map (channel=1).
  
  Args:
      image: a tensor with the shape of BxCxHxW representing HoVerMap
docstr_tok: ["Compute","the","Sobel","gradients","of","the","horizontal","vertical","map","(","HoVerMap",")",".","More","specifically",",","it","will","compute","horizontal","gradient","of","the","input","horizontal","gradient","map","(","channel=0",")","and","vertical","gradient","of","the","input","vertical","gradient","map","(","channel=1",")",".","Args",":","image",":","a","tensor","with","the","shape","of","BxCxHxW","representing","HoVerMap"]
code: def _compute_sobel(self, image: torch.Tensor) -> torch.Tensor:
      """Compute the Sobel gradients of the horizontal vertical map (HoVerMap).
      More specifically, it will compute horizontal gradient of the input horizontal gradient map (channel=0) and
      vertical gradient of the input vertical gradient map (channel=1).
  
      Args:
          image: a tensor with the shape of BxCxHxW representing HoVerMap
  
      """
      result_h = self.sobel_h(image[:, 0])
      result_v = self.sobel_v(image[:, 1])
      return torch.stack([result_h, result_v], dim=1)
  
file_path: MONAI/monai/apps/pathology/losses/hovernet_loss.py
imports: from __future__ import annotations
  import torch
  from torch.nn import CrossEntropyLoss
  from torch.nn import functional
  from torch.nn.modules.loss import _Loss
  from monai.losses import DiceLoss
  from monai.transforms import SobelGradients
  from monai.utils.enums import HoVerNetBranch
label_desc: Use image node_id 2 for calling the HoVerNetLoss obj's underlying member method code with example usage: obj._compute_sobel(image) and returns: torch