From 09b8738d73ebc37dda09e8c6dd05e35609999c77 Mon Sep 17 00:00:00 2001 From: Rodrigo Benenson Date: Thu, 22 Oct 2015 18:18:08 +0200 Subject: diff.ndim != 4 is outdated this code seems not to apply to the caffe head. ``` if diff.ndim != 4: raise Exception('{} diff is not 4-d'.format(top)) ``` --- python/caffe/pycaffe.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/python/caffe/pycaffe.py b/python/caffe/pycaffe.py index 8ea24da4..7bd4f411 100644 --- a/python/caffe/pycaffe.py +++ b/python/caffe/pycaffe.py @@ -146,8 +146,6 @@ def _Net_backward(self, diffs=None, start=None, end=None, **kwargs): # Set top diffs according to defined shapes and make arrays single and # C-contiguous as Caffe expects. for top, diff in kwargs.iteritems(): - if diff.ndim != 4: - raise Exception('{} diff is not 4-d'.format(top)) if diff.shape[0] != self.blobs[top].num: raise Exception('Diff is not batch sized') self.blobs[top].diff[...] = diff -- cgit v1.2.3