message: [Grappler] Fix bug in node signature hash in arithmetic_optimizer. The order of (input_node, port) and (attribute name, attribute value) matters.
diff: @@ -3391,13 +3391,15 @@ uint64 UniqueNodes::ComputeSignature(const NodeDef& node) {
  for (const auto& input : node.input()) {
  const TensorId input_tensor = ParseTensorName(input);
  - h = Hash64CombineUnordered(
  - Hash64(input_tensor.node().data(), input_tensor.node().size()), h);
  - h = Hash64CombineUnordered(std::hash<int>()(input_tensor.index()), h);
  + uint64 input_hash = Hash64Combine(
  + Hash64(input_tensor.node().data(), input_tensor.node().size()),
  + std::hash<int>()(input_tensor.index()));
  + h = Hash64CombineUnordered(input_hash, h);
  }
  for (const auto& attr : node.attr()) {
  - h = Hash64CombineUnordered(Hash64(attr.first), h);
  - h = Hash64CombineUnordered(FastAttrValueHash(attr.second), h);
  + uint64 attr_hash =
  + Hash64Combine(Hash64(attr.first), FastAttrValueHash(attr.second));
  + h = Hash64CombineUnordered(attr_hash, h);
  }
  memoized_signatures_.emplace(&node, h);
  return h;
  