2da86542c46c23ea1ee7e2e214eb685349a6bb75,official/nlp/modeling/ops/decoding_module.py,,shape_list,#Any#,65
Before Change
def shape_list(tensor):
Return a list of the tensor"s shape, and ensure no None values in list.
// Get statically known shape (may contain None"s for unknown dimensions)
shape = tensor.get_shape().as_list()
// Ensure that the shape values are not None
dynamic_shape = tf.shape(tensor)
for i in range(len(shape)): // pylint: disable=consider-using-enumerate
if shape[i] is None:
shape[i] = dynamic_shape[i]
return shape
def get_shape_keep_last_dim(tensor):
After Change
def shape_list(tensor):
Return a list of the tensor"s shape, and ensure no None values in list.
return tf_utils.get_shape_list(tensor)
def get_shape_keep_last_dim(tensor):
shape_list_obj = shape_list(tensor)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances Project Name: tensorflow/models
Commit Name: 2da86542c46c23ea1ee7e2e214eb685349a6bb75
Time: 2021-03-22
Author: poorvap@google.com
File Name: official/nlp/modeling/ops/decoding_module.py
Class Name:
Method Name: shape_list
Project Name: onnx/onnx-tensorflow
Commit Name: adc869e88b109af683ac94251165f96f7a406bba
Time: 2019-10-04
Author: wtsang@us.ibm.com
File Name: onnx_tf/handlers/backend/reduce_log_sum.py
Class Name: ReduceLogSum
Method Name: version_1
Project Name: onnx/onnx-tensorflow
Commit Name: adc869e88b109af683ac94251165f96f7a406bba
Time: 2019-10-04
Author: wtsang@us.ibm.com
File Name: onnx_tf/handlers/backend/reduce_sum_square.py
Class Name: ReduceSumSquare
Method Name: version_1