• Gunnlaugur Thor Briem's avatar
    Use class decorator instead of superclass · 0c716ede
    Gunnlaugur Thor Briem authored
    When supplied by Keras deserialization, the config parameter to initializers
    will be a dict. So intercept it and convert to PretrainedConfig object (and
    store in instance attribute for get_config to get at it) before passing to the
    actual initializer. To accomplish this, and repeat as little code as possible,
    use a class decorator on TF*MainLayer classes.
    0c716ede
modeling_tf_transfo_xl.py 34.3 KB