Skip to content

Commit

Permalink
add tests for pycaffe's layer_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
nitnelave committed Jun 22, 2016
1 parent b29d271 commit 5417f10
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/caffe/test/test_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ def test_memory(self):
for bl in blobs:
total += bl.data.sum() + bl.diff.sum()

def test_layer_dict(self):
layer_dict = self.net.layer_dict
self.assertEqual(list(layer_dict.keys()), list(self.net._layer_names))
for i, name in enumerate(self.net._layer_names):
self.assertEqual(layer_dict[name].type,
self.net.layers[i].type)

def test_forward_backward(self):
self.net.forward()
self.net.backward()
Expand Down

0 comments on commit 5417f10

Please sign in to comment.