-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* static model loader * implement model loading * add test * use pinned memory c# * standar memcpy * lint * fix includes * clang * memcpy in constuctor * lint * address comments * lint * comments * lint * CI * copy model outside of lambda * standard memcpy
- Loading branch information
Showing
14 changed files
with
210 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "binding_static_model.h" | ||
|
||
using namespace rl_net_native; | ||
using namespace reinforcement_learning; | ||
|
||
binding_static_model::binding_static_model(const char* vw_model, const size_t len) : vw_model(vw_model), len(len) {} | ||
|
||
int binding_static_model::get_data(model_transport::model_data& data, reinforcement_learning::api_status* status) | ||
{ | ||
return data.set_data(vw_model, len); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#pragma once | ||
|
||
#include "err_constants.h" | ||
#include "model_mgmt.h" | ||
|
||
#include <cstring> | ||
|
||
namespace model_transport = reinforcement_learning::model_management; | ||
|
||
namespace rl_net_native | ||
{ | ||
|
||
namespace constants | ||
{ | ||
const char* const BINDING_DATA_TRANSPORT = "BINDING_DATA_TRANSPORT"; | ||
} | ||
class binding_static_model : public model_transport::i_data_transport | ||
{ | ||
public: | ||
binding_static_model(const char* vw_model, const size_t len); | ||
int get_data(model_transport::model_data& data, reinforcement_learning::api_status* status = nullptr) override; | ||
|
||
private: | ||
const char* vw_model; | ||
const size_t len; | ||
}; | ||
} // namespace rl_net_native |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
using System.Collections.Generic; | ||
|
||
using Rl.Net.Native; | ||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters