class_docstr: Tests :func:`texar.tf.core.layers.get_activation_fn`.
      
docstr: Tests.
          
docstr_tok: ["Tests","."]
code: def test_get_activation_fn(self):
      """Tests."""
      fn = layers.get_activation_fn()
      self.assertEqual(fn, tf.identity)
  
      fn = layers.get_activation_fn("relu")
      self.assertEqual(fn, tf.nn.relu)
  
      inputs = tf.random_uniform([64, 100], -5, 20, dtype=tf.int32)
  
      fn = layers.get_activation_fn("leaky_relu")
      fn_output = fn(inputs)
      ref_output = tf.nn.leaky_relu(inputs)
      with self.test_session() as sess:
          sess.run(tf.global_variables_initializer())
          fn_output_, ref_output_ = sess.run([fn_output, ref_output])
          np.testing.assert_array_equal(fn_output_, ref_output_)
  
      fn = layers.get_activation_fn("leaky_relu", kwargs={"alpha": 0.1})
      fn_output = fn(inputs)
      ref_output = tf.nn.leaky_relu(inputs, alpha=0.1)
      with self.test_session() as sess:
          sess.run(tf.global_variables_initializer())
          fn_output_, ref_output_ = sess.run([fn_output, ref_output])
          np.testing.assert_array_equal(fn_output_, ref_output_)
  
imports: import numpy
  import tensorflow
  import tensorflow.contrib.rnn
  import texar.tf
  from texar.tf import context
  from texar.tf.hyperparams import HParams
  from texar.tf.core import layers
label_desc: Use image node_id 1 for calling the GetActivationFnTest obj's underlying member method code with example usage: obj.test_get_activation_fn() without return types