class_docstr: ### Middle block
  
  It combines a `ResidualBlock`, `AttentionBlock`, followed by another `ResidualBlock`.
  This block is applied at the lowest resolution of the U-Net.
class_docstr_tok: ["#","#","#","Middle","block","It","combines","a","`","ResidualBlock","`",",","`","AttentionBlock","`",",","followed","by","another","`","ResidualBlock","`",".","This","block","is","applied","at","the","lowest","resolution","of","the","U-Net","."]
code: def __init__(self, n_channels: int, time_channels: int):
      super().__init__()
      self.res1 = ResidualBlock(n_channels, n_channels, time_channels)
      self.attn = AttentionBlock(n_channels)
      self.res2 = ResidualBlock(n_channels, n_channels, time_channels)
  
imports: import math
  from typing import Optional, Tuple, Union, List
  import torch
  from torch import nn
  from labml_helpers.module import Module
label_desc: Use image node_id 1 to create a new MiddleBlock object from inherited base classes: Module with example: obj = MiddleBlock(n_channels, time_channels)