code: def test_op_future_value(
      input_size, time_step, initial_state, device_id, precision
  ):
      dt = PRECISION_TO_TYPE[precision]
  
      expected_forward_list = []
      expected_backward_list = []
  
      num_of_seq = input_size[0]
      total_elements_in_seq = np.product(input_size[1:])
      x = np.arange(
          total_elements_in_seq * num_of_seq, dtype=dt
      ).reshape(input_size)
      elem_shape = input_size[2:]
      for seq in x:
          elements_to_roll = (
              total_elements_in_seq - np.product(elem_shape) * time_step
          )
          x_rolled = np.roll(AA(seq, dtype=dt), elements_to_roll)
          np.put(
              x_rolled,
              range(elements_to_roll, total_elements_in_seq),
              initial_state,
          )
  
          expected_forward_list.append(AA(x_rolled, dtype=dt))
          backward = np.ones_like(x_rolled, dtype=dt)
          np.put(
              backward,
              range(total_elements_in_seq - elements_to_roll),
              0.0,
          )
          expected_backward_list.append(backward)
  
      expected_forward = AA(expected_forward_list, dtype=dt)
  
      a = sequence.input_variable(
          shape=elem_shape,
          dtype=sanitize_dtype_cntk(precision),
          needs_gradient=True,
          name="a",
      )
  
      expected_backward = {a: AA(expected_backward_list, dtype=dt)}
      init = parameter(
          init=AA(initial_state, dtype=dt),
          device=cntk_device(device_id),
      )
  
      input_op_input = sequence.future_value(a, init, time_step)
  
      unittest_helper(
          input_op_input,
          x,
          expected_forward,
          expected_backward,
          device_id=device_id,
          precision=precision,
      )
  
file_path: CNTK/bindings/python/cntk/ops/tests/recurrent_test.py
imports: from __future__ import division
  import numpy
  import pytest
  from .ops_test_utils import _test_binary_op, AA, precision, PRECISION_TO_TYPE, unittest_helper, sanitize_dtype_cntk, cntk_device
  from ..None import parameter, sequence
label_desc: Use image node_id 1 for calling a global function with example usage: test_op_future_value(input_size, time_step, initial_state, device_id, precision) without return types