ec9dcf7491c38f3531bfa718b496861ab19bb048,tensorflow_transform/analyzer_nodes.py,_VocabularyAccumulatorCoder,encode_cache,#_VocabularyAccumulatorCoder#Any#,430
Before Change
token = tf.compat.as_text(token)
// If the value is a _WeightedMeanAndVarAccumulator, cast each field to a
// list for serialization.
try:
value = value._replace(
count=value.count.tolist(),
mean=value.mean.tolist(),
variance=value.variance.tolist(),
weight=value.weight.tolist())
except AttributeError:
pass
accumulator = (token, value)
return tf.compat.as_bytes(
json.dumps(np.array(accumulator, dtype=object).tolist()))
After Change
// list for serialization.
if isinstance(value, tuple):
value = [
a.tolist()
for a in (value.count, value.mean, value.variance, value.weight)
]
value = tf.compat.as_bytes(json.dumps(value))
len_token, len_value = len(token), len(value)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: tensorflow/transform
Commit Name: ec9dcf7491c38f3531bfa718b496861ab19bb048
Time: 2019-08-28
Author: zoy@google.com
File Name: tensorflow_transform/analyzer_nodes.py
Class Name: _VocabularyAccumulatorCoder
Method Name: encode_cache
Project Name: modAL-python/modAL
Commit Name: 143067c9b8ffe094efe610e6353208b55ea040a3
Time: 2020-10-16
Author: hristov@excentos.com
File Name: modAL/utils/data.py
Class Name:
Method Name: data_hstack
Project Name: modAL-python/modAL
Commit Name: 143067c9b8ffe094efe610e6353208b55ea040a3
Time: 2020-10-16
Author: hristov@excentos.com
File Name: modAL/utils/data.py
Class Name:
Method Name: data_vstack