Hide methods and properties defined in the base classes of keras layers.
()
| 183 | |
| 184 | |
| 185 | def _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 | |
| 207 | def build_docs(output_dir, code_url_prefix, search_hints=True): |