docstr: Args:
      x: input should have spatially N dimensions
          ``(Batch, in_channels, dim_0[, dim_1, ..., dim_N-1])``, N is defined by `dimensions`.
          It is recommended to have ``dim_n % 16 == 0`` to ensure all maxpooling inputs have
          even edge lengths.
  
  Returns:
      A torch Tensor of "raw" predictions in shape
      ``(Batch, out_channels, dim_0[, dim_1, ..., dim_N-1])``.
docstr_tok: ["Args",":","x",":","input","should","have","spatially","N","dimensions","``","(","Batch",",","in_channels",",","dim_0","[",",","dim_1",",","...",",","dim_N-1","]",")","``",",","N","is","defined","by","`","dimensions","`",".","It","is","recommended","to","have","``","dim_n","%","16","==","0","``","to","ensure","all","maxpooling","inputs","have","even","edge","lengths",".","Returns",":","A","torch","Tensor","of","``","raw","''","predictions","in","shape","``","(","Batch",",","out_channels",",","dim_0","[",",","dim_1",",","...",",","dim_N-1","]",")","``","."]
code: def forward(self, x: torch.Tensor):
      """
      Args:
          x: input should have spatially N dimensions
              ``(Batch, in_channels, dim_0[, dim_1, ..., dim_N-1])``, N is defined by `dimensions`.
              It is recommended to have ``dim_n % 16 == 0`` to ensure all maxpooling inputs have
              even edge lengths.
  
      Returns:
          A torch Tensor of "raw" predictions in shape
          ``(Batch, out_channels, dim_0[, dim_1, ..., dim_N-1])``.
      """
      x_0_0 = self.conv_0_0(x)
      x_1_0 = self.conv_1_0(x_0_0)
      x_0_1 = self.upcat_0_1(x_1_0, x_0_0)
  
      x_2_0 = self.conv_2_0(x_1_0)
      x_1_1 = self.upcat_1_1(x_2_0, x_1_0)
      x_0_2 = self.upcat_0_2(x_1_1, torch.cat([x_0_0, x_0_1], dim=1))
  
      x_3_0 = self.conv_3_0(x_2_0)
      x_2_1 = self.upcat_2_1(x_3_0, x_2_0)
      x_1_2 = self.upcat_1_2(x_2_1, torch.cat([x_1_0, x_1_1], dim=1))
      x_0_3 = self.upcat_0_3(
          x_1_2, torch.cat([x_0_0, x_0_1, x_0_2], dim=1)
      )
  
      x_4_0 = self.conv_4_0(x_3_0)
      x_3_1 = self.upcat_3_1(x_4_0, x_3_0)
      x_2_2 = self.upcat_2_2(x_3_1, torch.cat([x_2_0, x_2_1], dim=1))
      x_1_3 = self.upcat_1_3(
          x_2_2, torch.cat([x_1_0, x_1_1, x_1_2], dim=1)
      )
      x_0_4 = self.upcat_0_4(
          x_1_3, torch.cat([x_0_0, x_0_1, x_0_2, x_0_3], dim=1)
      )
  
      output_0_1 = self.final_conv_0_1(x_0_1)
      output_0_2 = self.final_conv_0_2(x_0_2)
      output_0_3 = self.final_conv_0_3(x_0_3)
      output_0_4 = self.final_conv_0_4(x_0_4)
  
      if self.deep_supervision:
          output = [output_0_1, output_0_2, output_0_3, output_0_4]
      else:
          output = [output_0_4]
  
      return output
  
file_path: MONAI/monai/networks/nets/basic_unetplusplus.py
imports: from __future__ import annotations
  from collections.abc import Sequence
  import torch
  import torch.nn
  from monai.networks.layers.factories import Conv
  from monai.networks.nets.basic_unet import Down, TwoConv, UpCat
  from monai.utils import ensure_tuple_rep
label_desc: Use image node_id 2 for calling the BasicUNetPlusPlus obj's underlying member method code with example usage: obj.forward(x) and returns: output