Skip to content

Commit

Permalink
add test for top/bottom names
Browse files Browse the repository at this point in the history
  • Loading branch information
nitnelave committed Jul 12, 2016
1 parent e14b7f7 commit 7c50a2c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions python/caffe/test/test_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import numpy as np
import six
from collections import OrderedDict

import caffe

Expand Down Expand Up @@ -67,6 +68,18 @@ def test_inputs_outputs(self):
self.assertEqual(self.net.inputs, [])
self.assertEqual(self.net.outputs, ['loss'])

def test_top_bottom_names(self):
self.assertEqual(self.net.top_names,
OrderedDict([('data', ['data', 'label']),
('conv', ['conv']),
('ip', ['ip']),
('loss', ['loss'])]))
self.assertEqual(self.net.bottom_names,
OrderedDict([('data', []),
('conv', ['data']),
('ip', ['conv']),
('loss', ['ip', 'label'])]))

def test_save_and_read(self):
f = tempfile.NamedTemporaryFile(mode='w+', delete=False)
f.close()
Expand Down

0 comments on commit 7c50a2c

Please sign in to comment.