code: def test_volume_enforcement_equal(self):
      with self.cached_session():
          predicted = tf.constant(
              [
                  [-1000, 1000],
                  [1000, -1000],
                  [1000, -1000],
                  [1000, -1000],
              ],
              dtype=tf.float32,
              name="predicted",
          )
          labels = tf.constant(
              [1, 0, 0, 0], dtype=tf.int64, name="labels"
          )
  
          predicted, labels = [
              tf.expand_dims(x, axis=0) for x in (predicted, labels)
          ]
          venf_loss_func = LossFunction(2, loss_type="VolEnforcement")
          venf_loss = venf_loss_func(predicted, labels)
          self.assertAllClose(venf_loss.eval(), 0.0, atol=1e-4)
  
imports: from __future__ import absolute_import, print_function
  import numpy
  import tensorflow
  from niftynet.layer.loss_segmentation import LossFunction, labels_to_one_hot
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 1 for calling the VolumeEnforcementTest obj's underlying member method code with example usage: obj.test_volume_enforcement_equal() without return types