code: def test_custom_metric(self):
      def logcosh(y_true, y_pred):
          diff = y_pred - y_true
          return tf.reduce_mean(
              diff + tf.nn.softplus(-2.0 * diff) - tf.log(2.0), axis=-1
          )
  
      with self.test_session():
          x = Normal(loc=0.0, scale=1.0)
          x_data = tf.constant(0.0)
          ed.evaluate(logcosh, {x: x_data}, n_samples=1)
          ed.evaluate(
              ["mean_squared_error", logcosh], {x: x_data}, n_samples=1
          )
          self.assertRaises(
              NotImplementedError,
              ed.evaluate,
              "logcosh",
              {x: x_data},
              n_samples=1,
          )
  
file_path: edward/tests/criticisms/evaluate_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import edward
  import numpy
  import tensorflow
  from edward.models import Bernoulli, Categorical, Multinomial, Normal
label_desc: Use image node_id 7 for calling the test_evaluate_class obj's underlying member method code with example usage: obj.test_custom_metric() and returns: tf