class_docstr: The weighted averaging of cell operations.
  Args:
      c: number of output channels.
      ops: a dictionary of operations. See also: ``Cell.OPS2D`` or ``Cell.OPS3D``.
      arch_code_c: binary cell operation code. It represents the operation results added to the output.
class_docstr_tok: ["The","weighted","averaging","of","cell","operations",".","Args",":","c",":","number","of","output","channels",".","ops",":","a","dictionary","of","operations",".","See","also",":","``","Cell.OPS2D","``","or","``","Cell.OPS3D","``",".","arch_code_c",":","binary","cell","operation","code",".","It","represents","the","operation","results","added","to","the","output","."]
docstr: Args:
      x: input tensor.
      weight: learnable architecture weights for cell operations. arch_code_c are derived from it.
  Return:
      out: weighted average of the operation results.
docstr_tok: ["Args",":","x",":","input","tensor",".","weight",":","learnable","architecture","weights","for","cell","operations",".","arch_code_c","are","derived","from","it",".","Return",":","out",":","weighted","average","of","the","operation","results","."]
code: def forward(
      self, x: torch.Tensor, weight: Optional[torch.Tensor] = None
  ):
      """
      Args:
          x: input tensor.
          weight: learnable architecture weights for cell operations. arch_code_c are derived from it.
      Return:
          out: weighted average of the operation results.
      """
      out = 0.0
      if weight is not None:
          weight = weight.to(x)
      for idx, _op in enumerate(self.ops):
          out = (
              (out + _op(x))
              if weight is None
              else out + _op(x) * weight[idx]
          )
      return out
  
imports: from __future__ import annotations
  import datetime
  import warnings
  from typing import Optional
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from monai.networks.blocks.dints_block import ActiConvNormBlock, FactorizedIncreaseBlock, FactorizedReduceBlock, P3DActiConvNormBlock
  from monai.networks.layers.factories import Conv
  from monai.networks.layers.utils import get_act_layer, get_norm_layer
  from monai.utils import optional_import
label_desc: Use image node_id 2 for calling the MixedOp obj's underlying member method code with example usage: obj.forward(x, weight) and returns: out