class_docstr: A version of BCEWithLogitsLoss where the pos_weight can be supplied dynamically in the `forward` call. 
class_docstr_tok: ["A","version","of","BCEWithLogitsLoss","where","the","pos_weight","can","be","supplied","dynamically","in","the","`","forward","`","call","."]
code: def forward(
      self,
      input: pt.Tensor,
      target: pt.Tensor,
      pos_weight: Optional[pt.Tensor] = None,
  ) -> pt.Tensor:
      if pos_weight is None:
          pos_weight = self.pos_weight
  
      return pt.nn.functional.binary_cross_entropy_with_logits(
          input,
          target,
          self.weight,
          pos_weight=pos_weight,
          reduction=self.reduction,
      )
  
imports: import logging
  import math
  from abc import ABC, abstractmethod
  from typing import Any, Dict, Optional, Tuple
  import torch
  import numpy
  from .None import constants
  from .None import utils
label_desc: Use image node_id 2 for calling the DynamicBCEWithLogitsLoss obj's underlying member method code with example usage: obj.forward(input, target, pos_weight) and returns: pt