(q_shape, k_shape, v_shape, bias_shape, dtype)
| 1004 | |
| 1005 | |
| 1006 | def 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 | |
| 1017 | def test_attention_rewrite_offload(attention_rewrite_size): |
no test coverage detected
searching dependent graphs…