code: def __init__(
      self,
      in_features: int = 1,
      up: list[int] = [],
      down: list[int] = [],
      size: int = 5,
  ) -> None:
      super().__init__()
  
      if not len(down) == len(up) + 1:
          raise ValueError("`down` must be 1 item longer than `up`")
  
      self.up = up
      self.down = down
      self.in_features = in_features
  
      down_dims = [in_features, *down]
      self.path_down = nn.ModuleList()
      for i, (d_in, d_out) in enumerate(
          zip(down_dims[:-1], down_dims[1:])
      ):
          down_block = ThinUnetDownBlock(
              d_in, d_out, size=size, is_first=i == 0
          )
          self.path_down.append(down_block)
  
      bot_dims = [down[-1], *up]
      hor_dims = down_dims[-2::-1]
      self.path_up = nn.ModuleList()
      for i, (d_bot, d_hor, d_out) in enumerate(
          zip(bot_dims, hor_dims, up)
      ):
          up_block = ThinUnetUpBlock(d_bot, d_hor, d_out, size=size)
          self.path_up.append(up_block)
  
      self.n_params = 0
      for param in self.parameters():
          self.n_params += param.numel()
  
file_path: kornia/kornia/feature/disk/_unets/unet.py
imports: from __future__ import annotations
  from torch import nn
  from kornia.core import Module, Tensor
  from .blocks import ThinUnetDownBlock, ThinUnetUpBlock
label_desc: Use image node_id 1 to create a new Unet object from inherited base classes: Module with example: obj = Unet(in_features, up, down, size)