class_docstr: An abstract interface for loss wrappers that allows flexible control of
  real examples, adversarial examples and labels. These losses are used
  for defenses (during model training).
class_docstr_tok: ["An","abstract","interface","for","loss","wrappers","that","allows","flexible","control","of","real","examples",",","adversarial","examples","and","labels",".","These","losses","are","used","for","defenses","(","during","model","training",")","."]
docstr: Forward propagate the loss.
  Loss should be a scalar value, independent of batch size (i.e. use
  reduce_mean over batch axis, don't use reduce_sum or return a tensor).
  Scalar losses are easier to add together, e.g. through `WeightedSum`.
  Mean losses are easier to redistribute across multiple replicas without
  needing to change learning rates, etc.
  :param x: tensor, a batch of inputs.
  :param y: tensor, a batch of outputs (1-hot labels typically).
docstr_tok: ["Forward","propagate","the","loss",".","Loss","should","be","a","scalar","value",",","independent","of","batch","size","(","i.e",".","use","reduce_mean","over","batch","axis",",","do","n't","use","reduce_sum","or","return","a","tensor",")",".","Scalar","losses","are","easier","to","add","together",",","e.g",".","through","`","WeightedSum","`",".","Mean","losses","are","easier","to","redistribute","across","multiple","replicas","without","needing","to","change","learning","rates",",","etc",".",":","param","x",":","tensor",",","a","batch","of","inputs",".",":","param","y",":","tensor",",","a","batch","of","outputs","(","1-hot","labels","typically",")","."]
code: def fprop(self, x, y):
      """Forward propagate the loss.
      Loss should be a scalar value, independent of batch size (i.e. use
      reduce_mean over batch axis, don't use reduce_sum or return a tensor).
      Scalar losses are easier to add together, e.g. through `WeightedSum`.
      Mean losses are easier to redistribute across multiple replicas without
      needing to change learning rates, etc.
      :param x: tensor, a batch of inputs.
      :param y: tensor, a batch of outputs (1-hot labels typically).
      """
      raise NotImplementedError
  
imports: import copy
  import json
  import os
  import warnings
  import numpy
  import tensorflow
  from cleverhans.attacks import Attack
  from cleverhans.compat import softmax_cross_entropy_with_logits
  from cleverhans.model import Model
  from cleverhans.utils import safe_zip
label_desc: Use image node_id 3 for calling the Loss obj's underlying member method code with example usage: obj.fprop(x, y) without return types