MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / test_copy_1d

Method test_copy_1d

external/ggml/examples/python/test_tensor.py:204–211  ·  view source on GitHub ↗
(self, ctx)

Source from the content-addressed store, hash-verified

202 assert lib.ggml_get_i32_1d(t, 0) == 42
203
204 def test_copy_1d(self, ctx):
205 t1 = lib.ggml_new_tensor_1d(ctx, lib.GGML_TYPE_F32, 10)
206 t2 = lib.ggml_new_tensor_1d(ctx, lib.GGML_TYPE_F32, 10)
207 a = np.arange(10, dtype=np.float32)
208 copy(a, t1)
209 copy(t1, t2)
210 assert np.allclose(a, numpy(t2))
211 assert np.allclose(numpy(t1), numpy(t2))
212
213class TestGraph:
214

Callers

nothing calls this directly

Calls 3

copyFunction · 0.90
numpyFunction · 0.90
ggml_new_tensor_1dMethod · 0.80

Tested by

no test coverage detected