code: def test_wgan_cost(backend_default):
      """
      Set up a Wasserstein GANCost transform and make sure cost and errors are getting
      computed correctly.
      """
      be = backend_default
      cost = GANCost(func="wasserstein")
      y_data = be.iobuf(5).fill(1.0)
      y_noise = be.iobuf(5).fill(2.0)
      output = be.iobuf(1)
      expected = be.iobuf(1)
      delta = be.iobuf(5)
  
      # fprop for discriminator cost
      output[:] = cost(y_data, y_noise)
      expected[:] = be.sum(y_data - y_noise, axis=0)
      tensors_allclose(output, expected)
  
      # bprop for wasserstein cost
      delta[:] = cost.bprop_data(y_data)
      assert allclose_with_out(delta.get(), 1.0)
  
      delta[:] = cost.bprop_noise(y_noise)
      assert allclose_with_out(delta.get(), -1.0)
  
      delta[:] = cost.bprop_generator(y_noise)
      assert allclose_with_out(delta.get(), 1.0)
  
file_path: neon/tests/test_gan.py
imports: from neon.initializers.initializer import Gaussian
  from neon.layers import Affine
  from neon.transforms import GANCost
  from neon.layers.container import Sequential, GenerativeAdversarial
  from utils import tensors_allclose, allclose_with_out
label_desc: Use image node_id 3 for calling a global function with example usage: test_wgan_cost(backend_default) without return types