Skip to content

Commit

Permalink
Added import export test for capsule layers
Browse files Browse the repository at this point in the history
  • Loading branch information
namish800 committed Nov 7, 2018
1 parent 7da7f10 commit 27728d5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/unit/keras_app/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,23 @@ def test_keras_import(self):
self.pad_test(model, 'pad_w', 2)


# **********Capsule Layers **************
class CapsuleLayerTest(unittest.TestCase, HelperFunctions):
def setUp(self):
self.client = Client()

def test_keras_import_export(self):
model_file = open(os.path.join(settings.BASE_DIR, 'example/keras',
'Capsnet.json'), 'r')
response = self.client.post(reverse('keras-import'), {'file': model_file})
response = json.loads(response.content)
net = get_shapes(response['net'])
response = self.client.post(reverse('keras-export'), {'net': json.dumps(net),
'net_name': ''})
response = json.loads(response.content)
self.assertEqual(response['result'], 'success')


# ********** Export json tests **********

# ********** Data Layers Test **********
Expand Down

0 comments on commit 27728d5

Please sign in to comment.