Add docstring.

This commit is contained in:
Francois Chollet 2017-03-13 12:18:02 -07:00
parent 4c56f32624
commit 1b0c056975

@ -2716,6 +2716,18 @@ def save_weights_to_hdf5_group(f, layers):
def preprocess_weights_for_loading(layer, weights,
original_keras_version=None,
original_backend=None):
"""Converts layers weights from Keras 1 format to Keras 2.
# Arguments
layer: Layer instance.
weights: List of weights values (Numpy arrays).
original_keras_version: Keras version for the weights, as a string.
original_backend: Keras backend the weights were trained with,
as a string.
# Returns
A list of weights values (Numpy arrays).
"""
if original_keras_version == '1':
if layer.__class__.__name__ == 'Conv1D':
shape = weights[0].shape