def tf_dtype(dtype):
<EOL>if dtype == '<STR_LIT:float>' or dtype == float or dtype == np.float32 or dtype == tf.float32:<EOL><INDENT>return tf.float32<EOL><DEDENT>elif dtype == np.float64 or dtype == tf.float64:<EOL><INDENT>return tf.float64<EOL><DEDENT>elif dtype == np.float16 or dtype == tf.float16:<EOL><INDENT>return tf.float16<EOL><DEDENT>elif dtype == '<STR_LIT:int>' or dtype == int or dtype == np.int32 or dtype == tf.int32:<EOL><INDENT>return tf.int32<EOL><DEDENT>elif dtype == np.int64 or dtype == tf.int64:<EOL><INDENT>return tf.int64<EOL><DEDENT>elif dtype == np.int16 or dtype == tf.int16:<EOL><INDENT>return tf.int16<EOL><DEDENT>elif dtype == '<STR_LIT:bool>' or dtype == bool or dtype == np.bool_ or dtype == tf.bool:<EOL><INDENT>return tf.bool<EOL><DEDENT>else:<EOL><INDENT>raise TensorForceError("<STR_LIT>".format(str(dtype)))<EOL><DEDENT>
Translates dtype specifications in configurations to tensorflow data types.

       Args:
           dtype: String describing a numerical type (e.g. 'float'), numpy data type,
               or numerical type primitive.

       Returns: TensorFlow data type