summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Tolmer <valentin.tolmer@gmail.com>2016-06-21 17:17:05 -0700
committerValentin Tolmer <valentin.tolmer@gmail.com>2016-07-12 16:33:52 -0700
commit7c50a2cb87c6b044f85ced87273d302fb21394f7 (patch)
tree72855995e90e388f6f8068c81dd87d4337e0784d
parente14b7f7ea597afe532bf1c4d4013f2c63494d7a6 (diff)
downloadcaffeonacl-7c50a2cb87c6b044f85ced87273d302fb21394f7.tar.gz
caffeonacl-7c50a2cb87c6b044f85ced87273d302fb21394f7.tar.bz2
caffeonacl-7c50a2cb87c6b044f85ced87273d302fb21394f7.zip
add test for top/bottom names
-rw-r--r--python/caffe/test/test_net.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/python/caffe/test/test_net.py b/python/caffe/test/test_net.py
index 4cacfcd0..96821e40 100644
--- a/python/caffe/test/test_net.py
+++ b/python/caffe/test/test_net.py
@@ -3,6 +3,7 @@ import tempfile
import os
import numpy as np
import six
+from collections import OrderedDict
import caffe
@@ -67,6 +68,18 @@ class TestNet(unittest.TestCase):
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()