(self, json_path)
Save XLNetConfig to a json file.
Save XLNetConfig to a json file.
Save XLNetConfig to a json file .
def to_json(self, json_path):
    """Save XLNetConfig to a json file."""
    json_data = {}
    for key in self.keys:
      json_data[key] = getattr(self, key)

    json_dir = os.path.dirname(json_path)
    if not tf.gfile.Exists(json_dir):
      tf.gfile.MakeDirs(json_dir)
    with tf.gfile.Open(json_path, "w") as f:
      json.dump(json_data, f, indent=4, sort_keys=True)
def to_json ( self , json_path ) : json_data = { } for key in self . keys : json_data [ key ] = getattr ( self , key ) json_dir = os . path . dirname ( json_path ) if not tf . gfile . Exists ( json_dir ) : tf . gfile . MakeDirs ( json_dir ) with tf . gfile . Open ( json_path , "w" ) as f : json . dump ( json_data , f , indent = 4 , sort_keys = True )