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

Function ggml_tensor_set_f32

external/ggml/tests/test-timestep_embedding.cpp:20–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18#include <cmath>
19
20void ggml_tensor_set_f32(struct ggml_tensor* tensor, float value, int l, int k = 0, int j = 0, int i = 0) {
21 GGML_ASSERT(tensor->nb[0] == sizeof(float));
22 *(float*)((char*)(tensor->data) + i * tensor->nb[3] + j * tensor->nb[2] + k * tensor->nb[1] + l * tensor->nb[0]) = value;
23}
24
25void set_timestep_embedding(struct ggml_tensor* timesteps, struct ggml_tensor* embedding, int dim, int max_period = 10000) {
26 // timesteps: [N,]

Callers 1

set_timestep_embeddingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected