[mlgo][nfc] regalloc test model generator: prep for TFLite
authorMircea Trofin <mtrofin@google.com>
Thu, 11 Aug 2022 22:52:49 +0000 (15:52 -0700)
committerMircea Trofin <mtrofin@google.com>
Thu, 11 Aug 2022 22:53:23 +0000 (15:53 -0700)
Casting operator to make TFLite happy.

Reviewed By: yundiqian

Differential Revision: https://reviews.llvm.org/D131584

llvm/lib/Analysis/models/gen-regalloc-eviction-test-model.py

index 11bc3f2..e41e71a 100644 (file)
@@ -46,7 +46,8 @@ def build_mock_model(path):
   module.var = tf.Variable(0, dtype=tf.int64)
 
   def action(*inputs):
-    result = tf.math.argmax(tf.cast(inputs[0]['mask'], tf.int32), axis=-1) + module.var
+    result = tf.math.argmax(
+        tf.cast(inputs[0]['mask'], tf.int32), axis=-1) + module.var
     return {POLICY_DECISION_LABEL: result}
   module.action = tf.function()(action)
   action = {