334c0750a62000155366bc8257f950f420dec3f1,tensorflow_transform/beam/analysis_graph_builder.py,,_serialize_op_attr,#Any#,41

Before Change


          "Unable to serialize op attributes that contain a `list.func` field")
    if attr_value.HasField("func"):
      // TODO(b/138796127): Support tf.function fingerprint.
      result.append(uuid.uuid4().hex)
      attr_value.ClearField("func")
    result.append(attr_value.SerializeToString())
  return result

After Change


def _serialize_op_attr(op_attr):
  Deterministicly serializes tf.Operation attrs since it is a map.
  sorted_attributes = sorted(op_attr.items(), key=lambda kv: kv[0])
  if "f" in op_attr:
    // This is a tf.Function node, and it includes attributes that are
    // inconsistent across runs such as _gradient_op_type, config_proto, so we
    // only keep input and output types since other information will arrive from
    // the FuncGraph attributes.
    sorted_attributes = [
        kv for kv in sorted_attributes if kv[0] in ("Tin", "Tout")
    ]
  result = []
  for key, attr_value in sorted_attributes:
    result.append(key)
    attr_value = copy.deepcopy(attr_value)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: tensorflow/transform
Commit Name: 334c0750a62000155366bc8257f950f420dec3f1
Time: 2019-10-18
Author: zoy@google.com
File Name: tensorflow_transform/beam/analysis_graph_builder.py
Class Name:
Method Name: _serialize_op_attr


Project Name: comic/grand-challenge.org
Commit Name: 219836ccac7852a51df3f8b3b26c1e43f1f559c2
Time: 2020-05-21
Author: 51329283+miriam-groeneveld@users.noreply.github.com
File Name: app/grandchallenge/cases/image_builders/tiff.py
Class Name:
Method Name: image_builder_tiff


Project Name: bokeh/bokeh
Commit Name: 6d7069d9a13c2e15b7c7fd67a092cf9738f00347
Time: 2015-10-23
Author: hp@pobox.com
File Name: bokeh/embed.py
Class Name:
Method Name: autoload_static