import tensorflow as tf

                                 unconnected_gradients=tf.UnconnectedGradients.NONE)
            train_op = optimizer.apply_gradients(zip(grads, tf_sparse_demo.trainable_variables))
            with tf.control_dependencies([train_op]):
                loss = tf.identity(loss)
                return loss, embedding_vector


        dataset = utils.tf_dataset(*random_samples, batchsize=args.global_batch_size,
                                   to_sparse_tensor=True, repeat=1)
        train_iterator = dataset.make_initializable_iterator()
        iterator_init = train_iterator.initializer

        inputs, labels = train_iterator.get_next()
        graph_results = _train_step(inputs, labels, training=True)

        init_op = tf.group(tf.global_variables_initializer(), tf.local_variables_initializer())

        restore_op = list()
        for i, embedding_weight in enumerate(tf_sparse_demo.embedding_weights):
            restore_op.append(embedding_weight.assign(tf.concat(init_tensors[i], axis=0)))

        emb_values = list()
        for embedding_weight in tf_sparse_demo.embedding_weights:
            if args.save_params:
                filepath = r"./embedding_variables/"
                utils.try_make_dirs(filepath)
                emb_values.append(embedding_weight.read_value())
            else:
                emb_values = tf.constant(1.0)

