MCPcopy Create free account
hub / github.com/pytorch/executorch / make_simple_generated_case

Function make_simple_generated_case

kernels/test/test_case_gen.py:282–303  ·  view source on GitHub ↗
(*args, torch_fn)

Source from the content-addressed store, hash-verified

280
281
282def make_simple_generated_case(*args, torch_fn):
283 cpp_args = tuple(
284 arg.cpp_arg if isinstance(arg, ArgForPyTorch) else arg
285 for arg in args
286 if not isinstance(arg, ArgForPyTorch) or arg.used_in_cpp()
287 )
288 torch_args = tuple(
289 argument_to_pytorch(arg) for arg in args if not isinstance(arg, ArgForPyTorch)
290 )
291 kwargs_for_torch_fn = dict(
292 arg.kwarg_pair
293 for arg in args
294 if isinstance(arg, ArgForPyTorch) and arg.used_in_torch()
295 )
296 return [
297 (
298 "SimpleGeneratedCase",
299 *cpp_args,
300 torch_fn(*torch_args, **kwargs_for_torch_fn),
301 ShapeDynamism.STATIC,
302 )
303 ]
304
305
306def gen_test_cases(suite_name: str, op_name: str, test_cases, test_f=False):

Callers 14

gen_test_case_op_clampFunction · 0.85
gen_test_case_op_cloneFunction · 0.85
gen_test_case_op_cumsumFunction · 0.85
gen_test_case_op_geluFunction · 0.85
gen_test_case_op_logFunction · 0.85
gen_test_case_op_logitFunction · 0.85
gen_test_case_op_meanFunction · 0.85
gen_test_case_op_reluFunction · 0.85
gen_test_case_op_softmaxFunction · 0.85

Calls 3

argument_to_pytorchFunction · 0.85
used_in_cppMethod · 0.80
used_in_torchMethod · 0.80

Tested by

no test coverage detected