def prefer_static_value(x):
static_x = tf.get_static_value(x)<EOL>if static_x is not None:<EOL><INDENT>return static_x<EOL><DEDENT>return x<EOL>
Return static value of tensor `x` if available, else `x`.

    Args:
      x: `Tensor` (already converted).

    Returns:
      Numpy array (if static value is obtainable), else `Tensor`.