code: def __init__(
      self, dim, dim_out, *, time_emb_dim, groups=8, dropout_rate=0.0
  ):
      super().__init__()
      # groups: Used in group norm.
      self.dim = dim
      self.dim_out = dim_out
      self.groups = groups
      self.dropout_rate = dropout_rate
      self.time_emb_dim = time_emb_dim
  
      self.mlp = nn.Sequential(Mish(), nn.Linear(time_emb_dim, dim_out))
      # Norm -> non-linearity -> conv format follows
      # https://github.com/hojonathanho/diffusion/blob/1e0dceb3b3495bbe19116a5e1b3596cd0706c543/diffusion_tf/nn.py#L55
      self.block1 = nn.Sequential(
          nn.GroupNorm(groups, dim),
          Mish(),
          nn.Conv2d(dim, dim_out, 3, padding=1),
      )
      self.block2 = nn.Sequential(
          nn.GroupNorm(groups, dim_out),
          Mish(),
          nn.Dropout(p=dropout_rate),
          nn.Conv2d(dim_out, dim_out, 3, padding=1),
      )
      self.res_conv = nn.Conv2d(dim, dim_out, 1)
  
imports: import math
  import kornia
  import torch
  import torch.nn.functional
  from einops import rearrange
  from torch import nn
label_desc: Use image node_id 1 to create a new ResnetBlock object from inherited base classes: nn with example: obj = ResnetBlock(dim, dim_out)