code: def output(self, Q, input_state_1, input_state_2, **kwargs):
      with tf.name_scope("Q-output"):
          # Number of samples depend on the state's batch size.
          # Each iteration we can try to predict direction from
          # multiple different starting points at the same time.
          input_shape = tf.shape(input_state_1)
          n_states = input_shape[1]
          Q_shape = tf.shape(Q)
  
          indices = tf.stack(
              [
                  # Number of repetitions depends on the size of
                  # the state batch
                  tf_utils.repeat(tf.range(Q_shape[0]), n_states),
                  # Each state is a coordinate (x and y)
                  # that point to some place on a grid.
                  tf.cast(tf_utils.flatten(input_state_1), tf.int32),
                  tf.cast(tf_utils.flatten(input_state_2), tf.int32),
              ],
              axis=1,
          )
  
          # Output is a matrix that has n_samples * n_states rows
          # and n_filters (which is Q.shape[1]) columns.
          return tf.gather_nd(Q, indices)
  
imports: import os
  import argparse
  from functools import partial
  import tensorflow
  from neupy import init, algorithms, storage
  from neupy.layers import *
  from neupy.utils import as_tuple, asfloat, tf_utils, tensorflow_session
  from loaddata import load_data
  from settings import MODELS_DIR, environments
  from evaluation import evaluate_accuracy
label_desc: Use image node_id 2 for calling the SelectValueAtStatePosition obj's underlying member method code with example usage: obj.output(Q, input_state_1, input_state_2) and returns: tf