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

Method support_set

tensorflow/python/autograph/pyct/qual_names.py:141–161  ·  view source on GitHub ↗

Returns the set of simple symbols that this QN relies on. This would be the smallest set of symbols necessary for the QN to statically resolve (assuming properties and index ranges are verified at runtime). Examples: 'a.b' has only one support symbol, 'a' 'a[i]' has two

(self)

Source from the content-addressed store, hash-verified

139
140 @property
141 def support_set(self):
142 """Returns the set of simple symbols that this QN relies on.
143
144 This would be the smallest set of symbols necessary for the QN to
145 statically resolve (assuming properties and index ranges are verified
146 at runtime).
147
148 Examples:
149 'a.b' has only one support symbol, 'a'
150 'a[i]' has two support symbols, 'a' and 'i'
151 """
152 # TODO(mdan): This might be the set of Name nodes in the AST. Track those?
153 roots = set()
154 if self.has_attr():
155 roots.update(self.parent.support_set)
156 elif self.has_subscript():
157 roots.update(self.parent.support_set)
158 roots.update(self.qn[1].support_set)
159 else:
160 roots.add(self)
161 return roots
162
163 def __hash__(self):
164 return hash(self.qn + (self._has_attr, self._has_subscript))

Callers

nothing calls this directly

Calls 4

has_attrMethod · 0.95
has_subscriptMethod · 0.95
updateMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected