def get_input(hparams, data_files): """Get the input.""" if FLAGS.problem == "pixel_help": data_source = input_utils.DataSource.PIXEL_HELP elif FLAGS.problem == "android_howto": data_source = input_utils.DataSource.ANDROID_HOWTO elif FLAGS.problem == "rico_sca": data_source = input_utils.DataSource.RICO_SCA else: raise ValueError("Unrecognized test: %s" % FLAGS.problem) tf.logging.info("Testing data_source=%s data_files=%s" % (FLAGS.problem, data_files)) dataset = input_utils.input_fn( data_files, FLAGS.decode_batch_size, repeat=1, data_source=data_source, max_range=hparams.max_span, max_dom_pos=hparams.max_dom_pos, max_pixel_pos=(hparams.max_pixel_pos), load_extra=True, load_dom_dist=(hparams.screen_encoder == "gcn")) iterator = tf.data.make_one_shot_iterator(dataset) features = iterator.get_next() return features
def input_fn(): return input_utils.input_fn(data_files=files, batch_size=batch_size, repeat=repeat, required_agreement=required_agreement, data_source=data_source, max_range=max_range, max_dom_pos=max_dom_pos, max_pixel_pos=max_pixel_pos, mean_synthetic_length=mean_synthetic_length, stddev_synthetic_length=stddev_synthetic_length, load_extra=load_extra, buffer_size=buffer_size, load_screen=load_screen, shuffle_size=shuffle_size, load_dom_dist=load_dom_dist)