class_docstr: Wrapper converting a loss function into a `Loss` object.
  
  This is to reuse logic of sample-weighted loss computation in `Loss` base
  class.
  
  Attributes:
    loss_fn: Underlying loss function.
    weight: Weight of this loss term in total loss. Should be applied outside
      of this class, e.g. `total_loss += loss.weight * loss(y_true, y_pred)`.
    batch_size_reduction: Whether to perform `SUM_OVER_BATCH_SIZE` reduction.
      This field is set in lieu of having `reduction=SUM_OVER_BATCH_SIZE`,
      because the latter is not supported when using with
      `tf.distribute.Strategy`.
code: def _is_binary_classification_loss(self):
      return self.loss_fn in (
          tf.keras.losses.binary_crossentropy,
          tf.keras.losses.hinge,
          tf.keras.losses.squared_hinge,
      ) or isinstance(
          self.loss_fn,
          (
              tf.keras.losses.BinaryCrossentropy,
              tf.keras.losses.Hinge,
              tf.keras.losses.SquaredHinge,
          ),
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import functools
  import types
  import attr
  import neural_structured_learning.configs
  from neural_structured_learning.lib import adversarial_neighbor
  import six
  import tensorflow
label_desc: Use image node_id 5 for calling the _LossWrapper obj's underlying member method code with example usage: obj._is_binary_classification_loss() and returns: unknown