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

Function _hide_layer_and_module_methods

tensorflow/tools/docs/generate2.py:185–204  ·  view source on GitHub ↗

Hide methods and properties defined in the base classes of keras layers.

()

Source from the content-addressed store, hash-verified

183
184
185def _hide_layer_and_module_methods():
186 """Hide methods and properties defined in the base classes of keras layers."""
187 # __dict__ only sees attributes defined in *this* class, not on parent classes
188 module_contents = list(tf.Module.__dict__.items())
189 layer_contents = list(tf.keras.layers.Layer.__dict__.items())
190
191 for name, obj in module_contents + layer_contents:
192 if name == "__init__":
193 continue
194
195 if isinstance(obj, property):
196 obj = obj.fget
197
198 if isinstance(obj, (staticmethod, classmethod)):
199 obj = obj.__func__
200
201 try:
202 doc_controls.do_not_doc_in_subclasses(obj)
203 except AttributeError:
204 pass
205
206
207def build_docs(output_dir, code_url_prefix, search_hints=True):

Callers 1

build_docsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected