def testPopPushFusionPrettyPrint(self): # Testing two things: That pop-push fusion does the expected thing, and that # push-skipping PrimOps print with exclamation marks as expected. This test # is likely to be brittle, and may want to be rearranged later. prog = test_programs.fibonacci_program() fused = stack.fuse_pop_push(prog) self.verify_program_pretty_print(fib_fused_pretty, fused)
def _fibonacci_execute(inputs, backend): with tf.compat.v2.name_scope('fibonacci_program'): return vm.execute(test_programs.fibonacci_program(), [inputs], max_stack_depth=15, backend=backend)
def interpret(n): return instructions.interpret(test_programs.fibonacci_program(), n)
def testFibonacci(self): self.verify_program_pretty_print(fibonacci_pretty_print, test_programs.fibonacci_program())