fix: resolve MSVC narrowing conversion warnings (#1969)

This commit is contained in:
leejet 2026-09-13 23:45:54 +08:00 committed by GitHub
parent ca37fad89a
commit 5a5400bf0c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 19 deletions

View File

@ -146,7 +146,7 @@ namespace SenseNovaU1 {
auto x = ggml_ext_timestep_embedding(ctx->ggml_ctx,
timesteps,
static_cast<int>(frequency_embedding_size),
10000.f,
10000,
1.f);
x = mlp_0->forward(ctx, x);
x = ggml_silu_inplace(ctx->ggml_ctx, x);

View File

@ -564,7 +564,7 @@ public:
int64_t chunk_frames = 5 * decoder->t_upscale;
int64_t pad = (chunk_frames - (num_frames % chunk_frames)) % chunk_frames;
result = ggml_ext_pad_ext(ctx->ggml_ctx, ctx->backend, result, 0, 0, 0, 0, 0, 0, 0, pad, false, false);
result = ggml_ext_pad_ext(ctx->ggml_ctx, ctx->backend, result, 0, 0, 0, 0, 0, 0, 0, static_cast<int>(pad), false, false);
int64_t num_chunks = (num_frames + pad) / chunk_frames;
auto to_trim = decoder->t_upscale - 1;

View File

@ -2789,9 +2789,9 @@ static sd::Tensor<float> sample_lms(denoise_cb_t model,
sd::Tensor<float> d_cur = (x - denoised) / sigma;
x += d_cur * lms_coeff[0];
if (max_order > 1) { // if max_order == 1, the history is not used (order always < 2)
int hist_size_p1 = hist.size() + 1;
int hist_size_p1 = static_cast<int>(hist.size()) + 1;
if (i) { // history does not exist at 1st step
int hist_max = hist.size() - 1;
int hist_max = static_cast<int>(hist.size()) - 1;
for (int c = 2; c <= order; c++)
x += hist[std::min(hist_max, hist_size_p1 - c + shift)] * lms_coeff[c - 1];
// max_order == 4 => hist[] index = 2, 1, 0