class_docstr: Residual Block for Diffusion Denoiser.
docstr: Calculate forward propagation.
  
  Args:
      x (torch.Tensor): Input tensor.
      condition (torch.Tensor): Conditioning tensor.
      step (torch.Tensor): Number of diffusion step.
  
  Returns:
      Union[torch.Tensor, torch.Tensor]: Output tensor.
docstr_tok: ["Calculate","forward","propagation",".","Args",":","x","(","torch.Tensor",")",":","Input","tensor",".","condition","(","torch.Tensor",")",":","Conditioning","tensor",".","step","(","torch.Tensor",")",":","Number","of","diffusion","step",".","Returns",":","Union","[","torch.Tensor",",","torch.Tensor","]",":","Output","tensor","."]
code: def forward(
      self, x: torch.Tensor, condition: torch.Tensor, step: torch.Tensor
  ) -> Union[torch.Tensor, torch.Tensor]:
      """Calculate forward propagation.
  
      Args:
          x (torch.Tensor): Input tensor.
          condition (torch.Tensor): Conditioning tensor.
          step (torch.Tensor): Number of diffusion step.
  
      Returns:
          Union[torch.Tensor, torch.Tensor]: Output tensor.
  
      """
      step = self.diff_proj(step).unsqueeze(-1)
      condition = self.cond_proj(condition)
      y = x + step
      y = self.conv(y) + condition
      gate, _filter = torch.chunk(y, 2, dim=1)
      y = torch.sigmoid(gate) * torch.tanh(_filter)
      y = self.out_proj(y)
      residual, skip = torch.chunk(y, 2, dim=1)
      return (x + residual) / math.sqrt(2.0), skip
  
imports: import math
  from typing import Optional, Union
  import numpy
  import torch
  from torch import nn
  from torch.nn import functional
  from espnet.nets.pytorch_backend.transformer.embedding import PositionalEncoding
label_desc: Use image node_id 2 for calling the ResidualBlock obj's underlying member method code with example usage: obj.forward(x, condition, step) and returns: unknown,  skip