def softmax_pass():
     x = Any()
     pattern = Call(P.Softmax(), [x])
     imm = Imm(0)
     target_0 = Call("make_tuple", [pattern])
     target = Call("tuple_getitem", [target_0, imm])
     return pattern, target
Exemple #2
0
 def softmax_pass():
     x = Any()
     pattern = Call(P.Softmax(), [x])
     imm = Imm(0)
     target_0 = Call("make_tuple", [pattern])
     target = Call(Constants.kTupleGetItem, [target_0, imm])
     return pattern, target
 def softmax_addn_pass():
     x = AnyPattern()
     softmax = P.Softmax()
     pattern = CallWith(softmax, inputs=[x])
     imm = Imm(0)
     target_0 = CallWith("make_tuple",
                         inputs=[pattern],
                         should_replace=False)
     target = CallWith("tuple_getitem",
                       inputs=[target_0, imm],
                       should_replace=False)
     return pattern, target