-
Notifications
You must be signed in to change notification settings - Fork 298
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
DirectMLX.h Split fix a tiny bug which caused by variable 'axisSizeSum' set but not used #223
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2322,7 +2322,6 @@ namespace dml | |
{ | ||
TensorDesc inputTensor = input.Impl()->GetOutputDesc(); | ||
detail::GraphBuilder* builder = input.Impl()->GetGraphBuilder(); | ||
uint32_t axisSizeSum = 0; | ||
|
||
std::vector<TensorDesc> outputTensors; | ||
outputTensors.reserve(outputAxisSizes.size()); | ||
|
@@ -2342,7 +2341,14 @@ namespace dml | |
axisSizeSum += outputAxisSize; | ||
} | ||
|
||
#if defined(_DEBUG) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
uint32_t axisSizeSum = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: tab |
||
for (uint32_t outputAxisSize : outputAxisSizes) | ||
{ | ||
axisSizeSum += outputAxisSize; | ||
} | ||
assert(axisSizeSum == inputTensor.sizes[axis]); | ||
#endif | ||
|
||
DML_SPLIT_OPERATOR_DESC desc = {}; | ||
desc.Axis = axis; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this now fail to compile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concur, as I see
axisSizeSum
being used on line 2342.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue #220 describes the detailed error log. The
axisSizeSum
used in 2342 only be assignment for the newer clang. TheaxisSizeSum
only be used forassert
statement on line 2345.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 2341 should be deleted now.