MCPcopy Index your code
hub / github.com/apache/tvm / make_numpy_inputs

Function make_numpy_inputs

tests/python/codegen/test_target_codegen_cuda_fastmath.py:255–264  ·  view source on GitHub ↗

Make the numpy inputs for the given dtype and case.

(dtype: str, case: MathCase)

Source from the content-addressed store, hash-verified

253
254
255def make_numpy_inputs(dtype: str, case: MathCase):
256 """Make the numpy inputs for the given dtype and case."""
257 lhs = np.array([0.25, 0.5, 1.0, 2.0, 4.0, 9.0, 16.0, 10.0], dtype=dtype)
258 if case.num_inputs == 1:
259 return [lhs]
260 elif case.num_inputs == 2:
261 rhs = np.array([2.0, 3.0, 0.5, 1.5, 0.25, 0.5, 2.0, 1.0], dtype=dtype)
262 return [lhs, rhs]
263 else:
264 raise ValueError(f"Unsupported number of inputs: {case.num_inputs}")
265
266
267def check_runtime(dtype: str, case: MathCase, executable: Executable):

Callers 1

check_runtimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…