Skip to content

[Placeholder] Update tests that were creating variables that were saved into. #1712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions tests/unittests/OperatorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2464,11 +2464,13 @@ TEST_P(Operator, IntRelu) {
auto *relu = F_->createRELU("relu", rescale, reluOutTy);
auto *dequantize = F_->createDequantize("dequantize", relu);

auto *save = F_->createSave("save", dequantize);
auto *save = F_->createSave(ctx_, "save", dequantize);
ctx_.allocate(mod_.getPlaceholders());

EE_.compile(CompilationMode::Infer, F_, ctx_);
EE_.run();

auto result = save->getVariable()->getHandle();
auto result = ctx_.get(save->getPlaceholder())->getHandle();
float expectedValue = std::max(0.0f, splatValue);
for (size_t i = 0; i < result.size(); i++) {
EXPECT_EQ(expectedValue, result.raw(i));
Expand All @@ -2485,11 +2487,12 @@ TEST_P(Operator, IntSplat) {
auto *splat = F_->createSplat("splat", splatTy, splatValue);
auto *dequantize = F_->createDequantize("dequantize", splat);

auto *save = F_->createSave("save", dequantize);
auto *save = F_->createSave(ctx_, "save", dequantize);
ctx_.allocate(mod_.getPlaceholders());
EE_.compile(CompilationMode::Infer, F_, ctx_);
EE_.run();

auto result = save->getVariable()->getHandle();
auto result = ctx_.get(save->getPlaceholder())->getHandle();
for (size_t i = 0; i < result.size(); i++) {
EXPECT_EQ(splatValue, result.raw(i));
}
Expand Down