MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / EqualAttrs

Method EqualAttrs

tensorflow/core/framework/node_def_util.cc:213–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213bool AttrSlice::EqualAttrs(AttrSlice other, Scratch* scratch) const {
214 if (size() != other.size()) return false;
215
216 for (const auto& attr : *other.attrs_) {
217 auto iter = attrs_->find(attr.first);
218 if (iter == attrs_->end()) return false;
219 // TODO(irving): Comparing AttrValues by proto is slightly buggy, since
220 // TensorProto is a nonunique representation of Tensor. This bug will go
221 // away once AttrSlice switches over to NodeInfo.
222 iter->second.SerializeToString(&scratch->a);
223 attr.second.SerializeToString(&scratch->b);
224 if (scratch->a != scratch->b) return false;
225 }
226 return true;
227}
228
229// The ... is to allow the caller to inject some value validation code. Use
230// just ; if no additional validation code is needed.

Callers 1

EquivalentMethod · 0.80

Calls 5

sizeFunction · 0.50
sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45
SerializeToStringMethod · 0.45

Tested by

no test coverage detected