class_docstr: Temporal convolutional layer that can be used for video (sequence of images) input Code mostly copied from:
  https://github.com/modelscope/modelscope/blob/1509fdb973e5871f37148a4b5e5964cafd43e64d/modelscope/models/multi_modal/video_synthesis/unet_sd.py#L1016
  
  Parameters:
      in_dim (`int`): Number of input channels.
      out_dim (`int`): Number of output channels.
      dropout (`float`, *optional*, defaults to `0.0`): The dropout probability to use.
class_docstr_tok: ["Temporal","convolutional","layer","that","can","be","used","for","video","(","sequence","of","images",")","input","Code","mostly","copied","from",":","https",":","\/\/github.com\/modelscope\/modelscope\/blob\/1509fdb973e5871f37148a4b5e5964cafd43e64d\/modelscope\/models\/multi_modal\/video_synthesis\/unet_sd.py","#","L1016","Parameters",":","in_dim","(","`","int","`",")",":","Number","of","input","channels",".","out_dim","(","`","int","`",")",":","Number","of","output","channels",".","dropout","(","`","float","`",",","*","optional","*",",","defaults","to","`","0.0","`",")",":","The","dropout","probability","to","use","."]
code: def forward(
      self, hidden_states: torch.Tensor, num_frames: int = 1
  ) -> torch.Tensor:
      hidden_states = (
          hidden_states[None, :]
          .reshape((-1, num_frames) + hidden_states.shape[1:])
          .permute(0, 2, 1, 3, 4)
      )
  
      identity = hidden_states
      hidden_states = self.conv1(hidden_states)
      hidden_states = self.conv2(hidden_states)
      hidden_states = self.conv3(hidden_states)
      hidden_states = self.conv4(hidden_states)
  
      hidden_states = identity + hidden_states
  
      hidden_states = hidden_states.permute(0, 2, 1, 3, 4).reshape(
          (hidden_states.shape[0] * hidden_states.shape[2], -1)
          + hidden_states.shape[3:]
      )
      return hidden_states
  
imports: from functools import partial
  from typing import Optional, Tuple, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from ..utils import USE_PEFT_BACKEND
  from .activations import get_activation
  from .attention import AdaGroupNorm
  from .attention_processor import SpatialNorm
  from .lora import LoRACompatibleConv, LoRACompatibleLinear
label_desc: Use image node_id 2 for calling the TemporalConvLayer obj's underlying member method code with example usage: obj.forward(hidden_states, num_frames) and returns: hidden_states