Skip to content
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
3 changes: 2 additions & 1 deletion orttraining/orttraining/core/graph/gradient_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ IMPLEMENT_GRADIENT_BUILDER(GetMatMulGradient) {
}
};

if (A_has_shape && B_has_shape && Y_has_shape) {
if (A_has_shape && B_has_shape && Y_has_shape &&
A_shape.size() >= 2 && B_shape.size() >= 2) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matmul schema only allow inputs with dim>=2.
I thought this is an implicit prerequisite? Are you seeing inputs with less then 2 dim?

Copy link
Contributor

@SherlockNoMad SherlockNoMad Feb 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw the discussion on team's channel, and understand now this is caused by a torch bug/"feature".
This fix is harmless.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out MatMul allows vectors.


In reply to: 571201490 [](ancestors = 571201490)

std::vector<AttributeProto> shared_attributes;
shared_attributes.push_back(MakeAttribute("beta", float(0)));
AttributeProto transpose_first_input = MakeAttribute("transA", int64_t(1));
Expand Down