b6d23b2e2dfc90480519ab52047006b1936fda02,keras/backend/tensorflow_backend.py,,batch_set_value,#Any#,865

Before Change


            `value` should be a Numpy array.
    """
    if tuples:
        ops = [tf.assign(x, np.asarray(value)) for x, value in tuples]
        get_session().run(ops)

After Change


        for x, value in tuples:
            value = np.asarray(value)
            tf_dtype = _convert_string_dtype(x.dtype.name.split("_")[0])
            assign_placeholder = tf.placeholder(tf_dtype, shape=value.shape)
            assign_ops.append(x.assign(assign_placeholder))
            feed_dict[assign_placeholder] = value
        get_session().run(assign_ops, feed_dict=feed_dict)

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: keras-team/keras
Commit Name: b6d23b2e2dfc90480519ab52047006b1936fda02
Time: 2016-07-28
Author: jer.despraz@gmail.com
File Name: keras/backend/tensorflow_backend.py
Class Name:
Method Name: batch_set_value


Project Name: NVIDIA/OpenSeq2Seq
Commit Name: 0087cadc21b723f49bff2c56416a2412e4db11e7
Time: 2018-06-15
Author: igor.a.gitman@gmail.com
File Name: open_seq2seq/optimizers/optimizers.py
Class Name:
Method Name: optimize_loss


Project Name: NervanaSystems/coach
Commit Name: b1e9ea48d86807382c5feca0d18a6bf71f5caa03
Time: 2019-01-03
Author: gouravr@amazon.com
File Name: rl_coach/architectures/tensorflow_components/savers.py
Class Name: GlobalVariableSaver
Method Name: __init__