Esempio n. 1
0
def redefining_var_as_list(a):
  # Initialize the tape
  _stack = tangent.Stack()
  x = a
  tangent.push(_stack, x, 'abc')
  x = [a]
  x = tangent.pop(_stack, 'abc')
  return a
Esempio n. 2
0
def stack_pushing(a):
  stack = tangent.Stack()
  y = a * a
  tangent.push(stack, a, 'abc')
  aa = tangent.pop(stack, 'abc')
  z = y * aa
  z = z * aa
  return z
Esempio n. 3
0
def useless_stack_ops(a):
  _stack = tangent.Stack()
  b = a * a
  tangent.push(_stack, b, 'abc')
  b = tangent.pop(_stack, 'abc')
  return a
Esempio n. 4
0
def apop(z, stack, op_id):
    tangent.push(stack, d[z], d[op_id])
Esempio n. 5
0
def tpush(x, stack, op_id):
    tangent.push(d[stack], d[x], d[op_id])