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

Before Change


            return ids[:, :top_beams, 1:]
    else:
        if top_beams == 1:
            return ids[:, 0, 1:], scores[:, 0]
        else:
            return ids[:, :top_beams, 1:], scores[:, :top_beams]

After Change


                              lp_constant=params.decode_constant)

    mask = tf.not_equal(ids, 0)
    output_length = tf.reduce_sum(tf.to_float(mask), axis=-1)

    // shape: [batch, beam_size]
    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)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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: deepchem/deepchem
Commit Name: 7c9123131cb9e353ee8f6e1245f41d77f85af713
Time: 2018-08-22
Author: peastman@stanford.edu
File Name: deepchem/models/tensorgraph/layers.py
Class Name: AtomicConvolution
Method Name: create_tensor


Project Name: deepchem/deepchem
Commit Name: 7656443e5933069b5bf60b3e04e0c74a8efe96f6
Time: 2017-04-18
Author: bharath.ramsundar@gmail.com
File Name: deepchem/models/tensorgraph/layers.py
Class Name: NeighborList
Method Name: compute_nbr_list