b6d23b2e2dfc90480519ab52047006b1936fda02,keras/backend/tensorflow_backend.py,,set_value,#Any#Any#,858

Before Change


    """Sets the value of a tensor variable,
    from a Numpy array.
    """
    tf.assign(x, np.asarray(value)).op.run(session=get_session())


def batch_set_value(tuples):

After Change


    from a Numpy array.
    """
    value = np.asarray(value)
    tf_dtype = _convert_string_dtype(x.dtype.name.split("_")[0])
    assign_placeholder = tf.placeholder(tf_dtype, shape=value.shape)
    assign_op = x.assign(assign_placeholder)
    get_session().run(assign_op, feed_dict={assign_placeholder: value})
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: set_value


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: NervanaSystems/coach
Commit Name: 619ea0944e1f652a426045038ee2977996733758
Time: 2019-01-02
Author: gouravr@amazon.com
File Name: rl_coach/architectures/tensorflow_components/savers.py
Class Name: GlobalVariableSaver
Method Name: restore