import tensorflow as tf


            clip_value = clipping_kwargs["value"]
            clipped_grads_and_vars = [(tf.clip_by_norm(g, clip_value), v) for (g, v) in zip(grads, variables)]

        elif clipping_method == "clip_by_value":

            clip_value = clipping_kwargs["value"]
            clipped_grads_and_vars = [(tf.clip_by_value(g, -clip_value, clip_value), v) for (g, v) in grads_and_vars if g is not None]

        elif not clipping_method:

            grads_and_vars_not_none = [(g, v) for (g, v) in grads_and_vars if g is not None]
            clipped_grads_and_vars = grads_and_vars_not_none

