--- /dev/null
+MODELFILE_SERVER="http://npuarchive.mooo.com/archive/nnfw/nn_framework_test"
+MODELFILE_NAME="matmul2x2.tflite"
+MODELFILE_MD5SUM="e53e10402fb6ab40f0dbba493ffe455d"
+STATUS="disabled"
+
+# this tflite is matmul (2x2 input, 2x2 const tensor)
+# the second 2x2 const tensor is [[1.1, 2.1],[3.1, 4.1]]
+#
+# enable this when we need to support matmul
+++ /dev/null
-MODELFILE_SERVER="http://npuarchive.mooo.com/archive/nnfw/nn_framework_test"
-MODELFILE_NAME="mul2x2.tflite"
-MODELFILE_MD5SUM="6a8fb24aaaf1688ed00afbf937e54110"
-
-# this tflite is mul (2x2 input, 2x2 const tensor)
-# the second 2x2 const tensor is [[1.1, 2.1],[3.1, 4.1]]
-# this is added to check if tensorflow lite calls MUL operation of NN api
# -----------
-class Mul2x2Freezer(base_freezer.BaseFreezer):
+class MatMul2x2Freezer(base_freezer.BaseFreezer):
'''
- class to generate tflite file that contains mul(x, y) where y is 2x2 const
+ class to generate tflite file that contains matmul(x, y) where y is 2x2 const
'''
def __init__(self, path):
super(self.__class__, self).__init__(path)
def getOutputDirectory(self):
- return os.path.join(self.root_output_path, 'mul2x2')
+ return os.path.join(self.root_output_path, 'matmul2x2')
def getTopNodeName(self):
- return "MUL2X2_TOP"
+ return "MATMUL2X2_TOP"
def getModelName(self):
- return "mul(2x2, 2x2)"
+ return "matmul(2x2, 2x2)"
def buildModel(self, sess):
y = tf.get_variable(
"y_var", [2, 2], dtype=tf.float32, initializer=tf.zeros_initializer())
- y_val = [[1.1, 2.1], [3.1, 4.1]]
-
- mulTop = tf.matmul(x_input, y, name=self.getTopNodeName())
+ matmulTop = tf.matmul(x_input, y, name=self.getTopNodeName())
init_op = tf.global_variables_initializer()
# Note if we use tf.const() instead of tf.get_variable(),
# an error will be thrown while generating checkpoint file (before freezing)
y_value = [[1.1, 2.1], [3.1, 4.1]]
- sess.run(tf.assign(y, y_val))
+ sess.run(tf.assign(y, y_value))
# returning (input_node_list, output_node_list)
- return ([x_input], [mulTop])
+ return ([x_input], [matmulTop])
import softmax_freezer
import add1x1_freezer
import add5x5_freezer
-import mul2x2_freezer
+import matmul2x2_freezer
# --------
freezer = add5x5_freezer.Add5x5Freezer(root_output_path)
freezer.createSaveFreezeModel()
- # generate TFLITE file for MUL (vector of shape [2,2], vector of shape [2,2])
- freezer = mul2x2_freezer.Mul2x2Freezer(root_output_path)
+ # generate TFLITE file for MATMUL (vector of shape [2,2], vector of shape [2,2])
+ freezer = matmul2x2_freezer.MatMul2x2Freezer(root_output_path)
freezer.createSaveFreezeModel()