def testMobilenetEdgeTpu(self): _, endpoints = mobilenet_v3.edge_tpu( tf.compat.v1.placeholder(tf.float32, (1, 224, 224, 3))) self.assertIn('Inference mode is created by default', mobilenet_v3.edge_tpu.__doc__) self.assertEqual(endpoints['layer_24'].shape, [1, 7, 7, 1280]) self.assertStartsWith(endpoints['layer_24'].name, 'MobilenetEdgeTPU')
def testMobilenetEdgeTpu(self, use_groupnorm): _, endpoints = mobilenet_v3.edge_tpu( tf.placeholder(tf.float32, (1, 224, 224, 3)), use_groupnorm=use_groupnorm) self.assertIn('Inference mode is created by default', mobilenet_v3.edge_tpu.__doc__) self.assertEqual(endpoints['layer_24'].shape, [1, 7, 7, 1280]) self.assertStartsWith( endpoints['layer_24'].name, 'MobilenetEdgeTPU') self.assertVariablesHaveNormalizerFn(use_groupnorm)
def testMobilenetEdgeTpuChangeScope(self): _, endpoints = mobilenet_v3.edge_tpu(tf.compat.v1.placeholder( tf.float32, (1, 224, 224, 3)), scope='Scope') self.assertStartsWith(endpoints['layer_24'].name, 'Scope')