Skip to content
This repository has been archived by the owner on Jul 10, 2021. It is now read-only.

Commit

Permalink
Fix for Python 2.7, starting to be annoying.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjc committed Apr 3, 2016
1 parent 96448ea commit 426498b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sknn/backend/lasagne/mlp.py
Expand Up @@ -7,6 +7,7 @@
import sys
import math
import time
import types
import logging
import itertools

Expand Down Expand Up @@ -369,7 +370,8 @@ def _array_to_mlp(self, array, nn):

# Handle namedtuple format returned by get_parameters() as special case.
# Must remove the last `name` item in the tuple since it's not a parameter.
data = tuple([d for d in data if type(d) != str])
string_types = getattr(types, 'StringTypes', tuple([str]))
data = tuple([d for d in data if not isinstance(d, string_types)])

params = self._mlp_get_layer_params(layer)
assert len(data) == len(params),\
Expand Down

0 comments on commit 426498b

Please sign in to comment.