parameters: (self)
return_statement: return ret
docstring: r"""Load metadata as a dict.
docstring_summary: r"""Load metadata as a dict.
docstring_tokens: r Load metadata as a dict .
function: def metadata(self):
          r"""Load metadata as a dict."""
          if not self._metadata.is_valid:
              logger.info("metadata is not valid!")
              return None
          ret = dict()
          try:
              user_info = pickle.loads(self._metadata.user_info)
          except:  # pylint: disable=bare-except
              logger.warning(
                  "can't parse user info by pickle, so return the original bytes object!"
              )
              user_info = self._metadata.user_info
          ret["user_info"] = user_info
          ret["graph_modified"] = self._metadata.graph_modified
          ret["optimized_for_inference"] = self._metadata.optimized_for_inference
          if ret["optimized_for_inference"]:
              ret.update(G.deserialize_infer_option(self._metadata.optimize_options))
          return ret
function_tokens: def metadata ( self ) : if not self . _metadata . is_valid : logger . info ( "metadata is not valid!" ) return None ret = dict ( ) try : user_info = pickle . loads ( self . _metadata . user_info ) except : # pylint: disable=bare-except logger . warning ( "can't parse user info by pickle, so return the original bytes object!" ) user_info = self . _metadata . user_info ret [ "user_info" ] = user_info ret [ "graph_modified" ] = self . _metadata . graph_modified ret [ "optimized_for_inference" ] = self . _metadata . optimized_for_inference if ret [ "optimized_for_inference" ] : ret . update ( G . deserialize_infer_option ( self . _metadata . optimize_options ) ) return ret