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

Function get_rand_output_values

devtools/bundled_program/util/test_util.py:90–104  ·  view source on GitHub ↗
(
    n_tensors: int,
    sizes: List[List[int]],
    dtype: torch.dtype,
    n_sets_per_plan_test: int,
    n_method_test_suites: int,
)

Source from the content-addressed store, hash-verified

88
89
90def get_rand_output_values(
91 n_tensors: int,
92 sizes: List[List[int]],
93 dtype: torch.dtype,
94 n_sets_per_plan_test: int,
95 n_method_test_suites: int,
96) -> List[List[MethodOutputType]]:
97 # pyre-ignore [7]: Expected `List[List[Sequence[Tensor]]]` but got `List[List[List[Tensor]]]`.
98 return [
99 [
100 [(torch.rand(*sizes[i]) - 0.5).to(dtype) for i in range(n_tensors)]
101 for _ in range(n_sets_per_plan_test)
102 ]
103 for _ in range(n_method_test_suites)
104 ]
105
106
107def get_rand_method_names(n_method_test_suites: int) -> List[str]:

Callers 1

get_random_test_suitesFunction · 0.85

Calls 1

toMethod · 0.45

Tested by

no test coverage detected