Skip to content

Commit

Permalink
Adding license info in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
svkeerthy committed Jan 15, 2024
1 parent 1857a29 commit 394c8ec
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
8 changes: 8 additions & 0 deletions test/MLBridgeTest.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
//===----------------------------------------------------------------------===//
//
// Part of the MLCompilerBridge Project, under the Apache 2.0 License.
// See the LICENSE file under home directory for license and copyright
// information.
//
//===----------------------------------------------------------------------===//

#include "MLModelRunner/MLModelRunner.h"
#include "MLModelRunner/ONNXModelRunner/ONNXModelRunner.h"
#include "MLModelRunner/PipeModelRunner.h"
Expand Down
21 changes: 14 additions & 7 deletions test/inference/HelloMLBridge_Env.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
//===----------------------------------------------------------------------===//
//
// Part of the MLCompilerBridge Project, under the Apache 2.0 License.
// See the LICENSE file under home directory for license and copyright
// information.
//
//===----------------------------------------------------------------------===//

#include "MLModelRunner/ONNXModelRunner/environment.h"
#include "MLModelRunner/ONNXModelRunner/utils.h"
#include "llvm/IR/Module.h"
Expand All @@ -6,18 +14,17 @@
using namespace MLBridge;
class HelloMLBridgeEnv : public Environment {
Observation CurrObs;

public:
HelloMLBridgeEnv() {
setNextAgent("agent");
};
Observation& reset() override;
Observation& step(Action) override;
HelloMLBridgeEnv() { setNextAgent("agent"); };
Observation &reset() override;
Observation &step(Action) override;

protected:
std::vector<float> FeatureVector;
};

Observation& HelloMLBridgeEnv::step(Action Action) {
Observation &HelloMLBridgeEnv::step(Action Action) {
CurrObs.clear();
std::copy(FeatureVector.begin(), FeatureVector.end(),
std::back_inserter(CurrObs));
Expand All @@ -26,7 +33,7 @@ Observation& HelloMLBridgeEnv::step(Action Action) {
return CurrObs;
}

Observation& HelloMLBridgeEnv::reset() {
Observation &HelloMLBridgeEnv::reset() {
std::copy(FeatureVector.begin(), FeatureVector.end(),
std::back_inserter(CurrObs));
return CurrObs;
Expand Down

0 comments on commit 394c8ec

Please sign in to comment.