docstr: Args:
      x: input should have spatially N dimensions
          ``(Batch, in_channels, dim_0[, dim_1, ..., dim_N-1])``, N is defined by `spatial_dims`.
          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","`","spatial_dims","`",".","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 `spatial_dims`.
              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])``.
      """
      x0 = self.conv_0(x)
  
      x1 = self.down_1(x0)
      x2 = self.down_2(x1)
      x3 = self.down_3(x2)
      x4 = self.down_4(x3)
  
      u4 = self.upcat_4(x4, x3)
      u3 = self.upcat_3(u4, x2)
      u2 = self.upcat_2(u3, x1)
      u1 = self.upcat_1(u2, x0)
  
      logits = self.final_conv(u1)
      return logits
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  from typing import Optional
  import torch
  import torch.nn
  from monai.networks.blocks import Convolution, UpSample
  from monai.networks.layers.factories import Conv, Pool
  from monai.utils import ensure_tuple_rep
label_desc: Use image node_id 2 for calling the BasicUNet obj's underlying member method code with example usage: obj.forward(x) and returns: logits