diff options
author | Borislav Stanimirov <b.stanimirov@abv.bg> | 2023-06-16 21:23:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-16 21:23:53 +0300 |
commit | 9cbf50c041a525d781c7764f493a5443924e4e38 (patch) | |
tree | 73c6331d8f95335616f3a20f71a9ad259431c3b7 /examples/baby-llama | |
parent | 3d0112261042b356621e93db3fa4c6798a5d098f (diff) |
build : fix and ignore MSVC warnings (#1889)
Diffstat (limited to 'examples/baby-llama')
-rw-r--r-- | examples/baby-llama/baby-llama.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/baby-llama/baby-llama.cpp b/examples/baby-llama/baby-llama.cpp index 0add6ad..50e14c4 100644 --- a/examples/baby-llama/baby-llama.cpp +++ b/examples/baby-llama/baby-llama.cpp @@ -4,6 +4,10 @@ #include <random> #include <cstring> +#if defined(_MSC_VER) +#pragma warning(disable: 4244 4267) // possible loss of data +#endif + float frand() { return (float)rand()/(float)RAND_MAX; } @@ -1470,7 +1474,7 @@ struct ggml_tensor * square_error_loss(struct ggml_context * ctx, struct ggml_te } struct ggml_tensor * cross_entropy_loss(struct ggml_context * ctx, struct ggml_tensor * a, struct ggml_tensor * b) { - const float eps = 1e-3; + const float eps = 1e-3f; return ggml_sum(ctx, ggml_neg(ctx, |