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

Function get_numpy_attention_input

tests/python/relax/test_codegen_cutlass.py:1006–1014  ·  view source on GitHub ↗
(q_shape, k_shape, v_shape, bias_shape, dtype)

Source from the content-addressed store, hash-verified

1004
1005
1006def get_numpy_attention_input(q_shape, k_shape, v_shape, bias_shape, dtype):
1007 q = np.random.randn(*q_shape).astype(dtype)
1008 k = np.random.randn(*k_shape).astype(dtype)
1009 v = np.random.randn(*v_shape).astype(dtype)
1010 if not bias_shape == "none":
1011 bias = np.random.randn(*bias_shape).astype(dtype)
1012 else:
1013 bias = None
1014 return q, k, v, bias
1015
1016
1017def test_attention_rewrite_offload(attention_rewrite_size):

Callers 1

Calls 1

astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…