Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiics committed Mar 28, 2020
1 parent bf7b44c commit 7084d5c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 70 deletions.
3 changes: 2 additions & 1 deletion include/tvm/ir/env_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class EnvFuncNode : public Object {
}

bool SEqualReduce(const EnvFuncNode* other, SEqualReducer equal) const {
return this == other;
// name uniquely identifies the env function.
return name == other->name;
}

static constexpr const char* _type_key = "EnvFunc";
Expand Down
1 change: 1 addition & 0 deletions include/tvm/ir/type_relation.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ class TypeRelationNode : public TypeConstraintNode {

bool SEqualReduce(const TypeRelationNode* other, SEqualReducer equal) const {
return
equal(func, other->func) &&
equal(args, other->args) &&
equal(num_inputs, other->num_inputs) &&
equal(attrs, other->attrs);
Expand Down
67 changes: 0 additions & 67 deletions tests/cpp/relay_pass_alpha_equal.cc

This file was deleted.

3 changes: 2 additions & 1 deletion tests/cpp/relay_pass_type_infer_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

#include <gtest/gtest.h>
#include <tvm/node/structural_equal.h>
#include <tvm/te/operation.h>
#include <tvm/relay/expr.h>
#include <tvm/relay/type.h>
Expand All @@ -38,7 +39,7 @@ TEST(Relay, SelfReference) {
auto type_fx = mod->Lookup("main");

auto expected = relay::FuncType(tvm::Array<relay::Type>{ tensor_type }, tensor_type, {}, {});
CHECK(relay::AlphaEqual(type_fx->checked_type(), expected));
CHECK(tvm::StructuralEqual()(type_fx->checked_type(), expected));
}

int main(int argc, char ** argv) {
Expand Down
3 changes: 2 additions & 1 deletion tests/cpp/relay_transform_sequential.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <gtest/gtest.h>
#include <topi/generic/injective.h>
#include <tvm/node/structural_equal.h>
#include <tvm/driver/driver_api.h>
#include <tvm/relay/expr.h>
#include <tvm/ir/module.h>
Expand Down Expand Up @@ -102,7 +103,7 @@ TEST(Relay, Sequential) {
auto mod1 = IRModule::FromExpr(expected_func);
mod1 = relay::transform::InferType()(mod1);
auto expected = mod1->Lookup("main");
CHECK(relay::AlphaEqual(f, expected));
CHECK(tvm::StructuralEqual()(f, expected));
}

int main(int argc, char** argv) {
Expand Down

0 comments on commit 7084d5c

Please sign in to comment.