class_docstr: Same as `nn.BCEWithLogitsLoss`, but flattens input and target.
code: def __init__(
      self,
      *args,
      axis: int = -1,  # Class axis
      floatify: bool = True,  # Convert `targ` to `float`
      thresh: float = 0.5,  # The threshold on which to predict
      **kwargs,
  ):
      if (
          kwargs.get("pos_weight", None) is not None
          and kwargs.get("flatten", None) is True
      ):
          raise ValueError(
              "`flatten` must be False when using `pos_weight` to avoid a RuntimeError due to shape mismatch"
          )
      if kwargs.get("pos_weight", None) is not None:
          kwargs["flatten"] = False
      super().__init__(
          nn.BCEWithLogitsLoss,
          *args,
          axis=axis,
          floatify=floatify,
          is_2d=False,
          **kwargs,
      )
      self.thresh = thresh
  
imports: from __future__ import annotations
  from .imports import *
  from .torch_imports import *
  from .torch_core import *
  from .layers import *
label_desc: Use image node_id 1 to create a new BCEWithLogitsLossFlat object from inherited base classes: BaseLoss with example: obj = BCEWithLogitsLossFlat()