import tensorflow as tf

from .util import funcname_scope, static_rank



@funcname_scope
def scalar_to_vec(scalar):
  assert static_rank(scalar) == 1
  return tf.expand_dims(scalar, [1])


@funcname_scope
def vec_to_mat(vec):
  assert static_rank(vec) == 2
  return tf.expand_dims(vec, [2])

@@ -63,16 +63,31 @@
 tic_rank
+, dtype_epsilon
 %0A%0A%0A%0A@fun
@@ -300,8 +300,94 @@
 c, %5B2%5D)%0A
+%0A%0A@funcname_scope%0Adef softmax_inverse(x):%0A  return tf.log(x + dtype_epsilon(x.dtype))%0A

Add math.softmax_inverse()