Skip to content

Commit

Permalink
[mlgo][nfc] regalloc test model generator: prep for TFLite
Browse files Browse the repository at this point in the history
Casting operator to make TFLite happy.

Reviewed By: yundiqian

Differential Revision: https://reviews.llvm.org/D131584
  • Loading branch information
mtrofin committed Aug 11, 2022
1 parent 7ff0ca1 commit 3486b1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/Analysis/models/gen-regalloc-eviction-test-model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 3486b1b

Please sign in to comment.