class_docstr: The base class of PaddleHub Module, users can inherit this class to implement to realize custom class.
class_docstr_tok: ["The","base","class","of","PaddleHub","Module",",","users","can","inherit","this","class","to","implement","to","realize","custom","class","."]
docstr: Get all sub modules.
  
  Args:
      recursive(bool): Whether to get sub modules recursively. Default to True.
docstr_tok: ["Get","all","sub","modules",".","Args",":","recursive","(","bool",")",":","Whether","to","get","sub","modules","recursively",".","Default","to","True","."]
code: def sub_modules(self, recursive: bool = True):
      """
      Get all sub modules.
  
      Args:
          recursive(bool): Whether to get sub modules recursively. Default to True.
      """
      _sub_modules = {}
      for key, item in self.__dict__.items():
          if id(item) == id(self):
              continue
  
          if isinstance(item, (RunModule, ModuleV1)):
              _sub_modules[key] = item
              if not recursive:
                  continue
  
              for _k, _v in item.sub_modules(recursive):
                  _sub_modules["{}/{}".format(key, _k)] = _v
  
      return _sub_modules
  
imports: import ast
  import builtins
  import codecs
  import inspect
  import os
  import re
  import sys
  from typing import Callable
  from typing import Generic
  from typing import List
  from typing import Optional
  from typing import Union
  import paddle
  import paddle2onnx
  from easydict import EasyDict
  from paddlehub.compat import paddle_utils
  from paddlehub.compat.module.module_v1 import ModuleV1
  from paddlehub.utils import log
  from paddlehub.utils import parser
  from paddlehub.utils import utils
label_desc: Use image node_id 10 for calling the RunModule obj's underlying member method code with example usage: obj.sub_modules(recursive) and returns: _sub_modules