class_docstr: Container for managing attribute cache state within a Layer.
  
  The cache can be invalidated either on an individual basis (for instance when
  an attribute is mutated) or a layer-wide basis (such as when a new dependency
  is added).
class_docstr_tok: ["Container","for","managing","attribute","cache","state","within","a","Layer",".","The","cache","can","be","invalidated","either","on","an","individual","basis","(","for","instance","when","an","attribute","is","mutated",")","or","a","layer-wide","basis","(","such","as","when","a","new","dependency","is","added",")","."]
code: def add_parent(self, node):
      # type: (AttributeSentinel, AttributeSentinel) -> None
  
      # Properly tracking removal is quite challenging; however since this is only
      # used to invalidate a cache it's alright to be overly conservative. We need
      # to invalidate the cache of `node` (since it has implicitly gained a child)
      # but we don't need to invalidate self since attributes should not depend on
      # parent Layers.
      self._parents.add(node)
      node.invalidate_all()
  
file_path: tensorflow-upstream/tensorflow/python/trackable/layer_utils.py
imports: import collections
  import weakref
  from tensorflow.python.util import object_identity
label_desc: Use image node_id 3 for calling the AttributeSentinel obj's underlying member method code with example usage: obj.add_parent(node) without return types