Commit e5b831a0 authored by Cianciosa, Mark's avatar Cianciosa, Mark
Browse files

Replace explicit loop with memcpy.

parent 0376ed90
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3,6 +3,8 @@
///  @brief Implimentation of the c binding library.
//------------------------------------------------------------------------------

#include <cstring>

#include "ml_c_embedder.h"
#include <ml_embedder.hpp>

@@ -38,9 +40,7 @@ ml_model mlce_init_mlx(const char *filename,
                       const int *in_shape,
                       const size_t num_dims) {
    mlx::core::SmallVector<int> shape(num_dims);
    for (size_t i = 0; i < num_dims; i++) {
        shape[i] = in_shape[i];
    }
    std::memcpy(shape.data(), in_shape, num_dims*sizeof(int));

    return reinterpret_cast<ml_model> (new ml_embedder::mlx_model(std::string(filename),
                                                                  shape));
−2.46 KiB (407 KiB)

File changed.

No diff preview for this file type.