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

Function make_rfft2d_tests

tensorflow/lite/testing/generate_examples_lib.py:5228–5257  ·  view source on GitHub ↗

Make a set of tests to do rfft2d.

(options)

Source from the content-addressed store, hash-verified

5226
5227@register_make_test_function()
5228def make_rfft2d_tests(options):
5229 """Make a set of tests to do rfft2d."""
5230
5231 test_parameters = [{
5232 "input_dtype": [tf.float32],
5233 "input_shape": [[8, 8], [3, 8, 8]],
5234 "fft_length": [
5235 None, [4, 4], [4, 8], [8, 4], [8, 8], [8, 16], [16, 8], [16, 16]
5236 ]
5237 }]
5238
5239 def build_graph(parameters):
5240 input_value = tf.placeholder(
5241 dtype=parameters["input_dtype"],
5242 name="input",
5243 shape=parameters["input_shape"])
5244 with spectral_ops_test_util.fft_kernel_label_map():
5245 outs = tf.signal.rfft2d(input_value, fft_length=parameters["fft_length"])
5246 return [input_value], [outs]
5247
5248 def build_inputs(parameters, sess, inputs, outputs):
5249 input_value = create_tensor_data(parameters["input_dtype"],
5250 parameters["input_shape"])
5251 return [input_value], sess.run(
5252 outputs, feed_dict=dict(zip(inputs, [input_value])))
5253
5254 extra_toco_options = ExtraTocoOptions()
5255 extra_toco_options.allow_custom_ops = True
5256 make_zip_of_tests(options, test_parameters, build_graph, build_inputs,
5257 extra_toco_options)
5258
5259
5260def generate_examples(options):

Callers

nothing calls this directly

Calls 2

ExtraTocoOptionsClass · 0.85
make_zip_of_testsFunction · 0.85

Tested by

no test coverage detected