Skip to content
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

[Relay] Type Relation Fixes #7362

Merged
merged 2 commits into from
Jan 28, 2021
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions src/relay/op/dyn/tensor/transform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,9 @@ bool FullRel(const Array<Type>& types, int num_inputs, const Attrs& attrs,
if (fill_value == nullptr) {
return false;
}
if (fill_shape == nullptr) {
return false;
}

DataType out_dtype = param->dtype;
if (out_dtype.bits() == 0) {
Expand Down
12 changes: 10 additions & 2 deletions src/relay/op/type_relations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ bool BroadcastRel(const Array<Type>& types, int num_inputs, const Attrs& attrs,
// << ",Out:" << types[2] << std::endl;
if (auto* t0 = types[0].as<TensorTypeNode>()) {
if (auto* t1 = types[1].as<TensorTypeNode>()) {
ICHECK_EQ(t0->dtype, t1->dtype);
if (t0->dtype != t1->dtype) {
reporter->GetDiagCtx().Emit(Diagnostic::Error(t0->span)
<< "data types " << t0->dtype << " and " << t1->dtype
<< "do not match in BroadcastRel");
}
reporter->Assign(
types[2], ConcreteBroadcast(GetRef<TensorType>(t0), GetRef<TensorType>(t1), t0->dtype));
return true;
Expand All @@ -120,7 +124,11 @@ bool BroadcastCompRel(const Array<Type>& types, int num_inputs, const Attrs& att
// << ",Out:" << types[2] << std::endl;
if (auto* t0 = types[0].as<TensorTypeNode>()) {
if (auto* t1 = types[1].as<TensorTypeNode>()) {
ICHECK_EQ(t0->dtype, t1->dtype);
if (t0->dtype != t1->dtype) {
reporter->GetDiagCtx().Emit(Diagnostic::Error(t0->span)
<< "data types " << t0->dtype << " and " << t1->dtype
<< "do not match in BroadcastCompRel");
}
reporter->Assign(types[2], ConcreteBroadcast(GetRef<TensorType>(t0), GetRef<TensorType>(t1),
DataType::Bool()));
return true;
Expand Down