MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / f

Function f

tensorflow/lite/testing/generate_examples_lib.py:615–654  ·  view source on GitHub ↗

Actual function that generates examples. Args: options: An Options instance. expected_tf_failures: number of expected tensorflow failures.

(options, expected_tf_failures=0)

Source from the content-addressed store, hash-verified

613 pool_op = pool_op_in
614
615 def f(options, expected_tf_failures=0):
616 """Actual function that generates examples.
617
618 Args:
619 options: An Options instance.
620 expected_tf_failures: number of expected tensorflow failures.
621 """
622
623 # Chose a set of parameters
624 test_parameters = [{
625 "ksize": [[2, 1, 1, 2], [1, 1, 1, 1], [1, 1, 2, 1], [1, 10, 11, 1]],
626 "strides": [[2, 1, 1, 2], [1, 1, 1, 1], [1, 1, 2, 1], [1, 10, 11, 1]],
627 # TODO(aselle): should add in a degenerate shape (e.g. [1, 0, 1, 1]).
628 "input_shape": [[], [1, 1, 1, 1], [1, 15, 14, 1], [3, 15, 14, 3]],
629 "padding": ["SAME", "VALID"],
630 "data_format": ["NHWC"], # TODO(aselle): NCHW would be good
631 }]
632
633 def build_graph(parameters):
634 input_tensor = tf.placeholder(
635 dtype=tf.float32, name="input", shape=parameters["input_shape"])
636 out = pool_op(
637 input_tensor,
638 ksize=parameters["ksize"],
639 strides=parameters["strides"],
640 data_format=parameters["data_format"],
641 padding=parameters["padding"])
642 return [input_tensor], [out]
643
644 def build_inputs(parameters, sess, inputs, outputs):
645 input_values = create_tensor_data(tf.float32, parameters["input_shape"])
646 return [input_values], sess.run(
647 outputs, feed_dict=dict(zip(inputs, [input_values])))
648
649 make_zip_of_tests(
650 options,
651 test_parameters,
652 build_graph,
653 build_inputs,
654 expected_tf_failures=expected_tf_failures)
655
656 return f
657

Callers

nothing calls this directly

Calls 1

make_zip_of_testsFunction · 0.85

Tested by

no test coverage detected