code: def test_consistency_loss(self):
      with self.cached_session():
          predicted = tf.constant(
              [
                  [[1, -1], [-1, 1], [1, -1]],
                  [[1, -1], [1, -1], [1, -1]],
              ],
              dtype=tf.float32,
          )
          predicted *= 1000
          pred_ave = [[[0.66, 0.33], [1, 0]]]
          test_loss_func = LossFunction(2, 3, loss_type="Consistency")
          computed_loss = test_loss_func(
              pred_ave=pred_ave, pred_multi=predicted
          )
          self.assertAllClose(computed_loss.eval(), 0, atol=1e-2)
  
file_path: NiftyNet/tests/loss_classification_multi_test.py
imports: from __future__ import absolute_import, print_function
  import numpy
  import tensorflow
  from niftynet.layer.loss_classification_multi import LossFunction, variability
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 1 for calling the LossConsistencyTest obj's underlying member method code with example usage: obj.test_consistency_loss() without return types