62d2ea56ae4a090aa68baf133137982a836700bd,thumt/utils/search.py,,create_inference_graph,#Any#Any#Any#,430

Before Change


                              lp_constant=params.decode_constant)

    // Set inputs back to the unexpanded inputs to not to confuse the Estimator
    features["source"] = inputs_old
    features["source_length"] = inputs_length_old

    // Return `top_beams` decoding

After Change


    normalized_scores = scores / output_length

    if params.decode_normalize:
        scores, indices = tf.nn.top_k(normalized_scores, k=top_beams)
        // shape of ids: [batch, beam_size, max_length]
        // shape of coordinates: [batch, beam_size, 2]
        batch_pos = compute_batch_indices(batch_size, beam_size)
        coordinates = tf.stack([batch_pos, indices], axis=2)
        ids = tf.gather_nd(ids, coordinates)

    // Return `top_beams` decoding
    // (also remove initial id from the beam search)
    return ids[:, :top_beams, 1:], scores[:, :top_beams]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: THUNLP-MT/THUMT
Commit Name: 62d2ea56ae4a090aa68baf133137982a836700bd
Time: 2018-01-25
Author: playinf@stu.xmu.edu.cn
File Name: thumt/utils/search.py
Class Name:
Method Name: create_inference_graph


Project Name: THUNLP-MT/THUMT
Commit Name: 62d2ea56ae4a090aa68baf133137982a836700bd
Time: 2018-01-25
Author: playinf@stu.xmu.edu.cn
File Name: thumt/utils/search.py
Class Name:
Method Name: create_inference_graph


Project Name: tensorflow/cleverhans
Commit Name: 4887ef8baecbf5315ec0f235e56a4f93cd05aad7
Time: 2018-10-04
Author: nottombrown@gmail.com
File Name: cleverhans/attacks_tf.py
Class Name:
Method Name: spm


Project Name: tensorflow/transform
Commit Name: 319d76de1d740a0500b9bc321ddc40bf3c032f71
Time: 2021-01-26
Author: zoy@google.com
File Name: tensorflow_transform/tf_utils.py
Class Name:
Method Name: reduce_batch_count_mean_and_var