From 1b0c05697553cfdefbe14faf0d33b1a19416adb0 Mon Sep 17 00:00:00 2001 From: Francois Chollet Date: Mon, 13 Mar 2017 12:18:02 -0700 Subject: [PATCH] Add docstring. --- keras/engine/topology.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/keras/engine/topology.py b/keras/engine/topology.py index a726c7aa8..85687439d 100644 --- a/keras/engine/topology.py +++ b/keras/engine/topology.py @@ -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