Repository navigation
STYLE: Replace |= true with = true in SampleGradients, in Optimizers - #1501
Merged
Merged
Conversation
Just for the sake of simplicity. `stochasticgradients |= true` is equivalent to `stochasticgradients = true` anyway.
N-Dekker
commented
Nov 25, 2026
| { | ||
| /** At least one of the metric has a random sampler. */ | ||
| stochasticgradients |= true; | ||
| stochasticgradients = true; |
Member
Author
There was a problem hiding this comment.
@stefanklein Just a funny cosmetic thing here! Why would you do |= true on a bool variable, when you can simply do = true? At least it looks like it was you, with commit 93bd2b2 (back in 2008)!
Member
|
Haha makes sense, nice catch! 😊
Kind regards,
Prof. dr. ir. Stefan Klein
Professor of Applied Medical Image Analysis
General Chair of Biomedical Imaging Group Rotterdam (BIGR)
Dept. of Radiology & Nuclear Medicine
***@***.***
+31 10 7043442<tel:+31%2010%207043442>
Van: Niels Dekker ***@***.***>
Verzonden: woensdag 25 november 2026 16:01
Aan: SuperElastix/elastix ***@***.***>
CC: Stefan Klein ***@***.***>; Mention ***@***.***>
Onderwerp: Re: [SuperElastix/elastix] STYLE: Replace `|= true` with `= true` in SampleGradients, in Optimizers (PR #1501)
Waarschuwing: Deze e-mail is afkomstig van buiten de organisatie. Klik niet op links en open geen bijlagen, tenzij u de afzender herkent en weet dat de inhoud veilig is.
Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
@N-Dekker commented on this pull request.
________________________________
In Components/Optimizers/AdaptiveStochasticGradientDescent/elxAdaptiveStochasticGradientDescent.hxx<#1501 (comment)>:
@@ -741,7 +741,7 @@ AdaptiveStochasticGradientDescent<TElastix>::SampleGradients(const ParametersTyp
if (randomSamplerVec[m].IsNotNull())
{
/** At least one of the metric has a random sampler. */
- stochasticgradients |= true;
+ stochasticgradients = true;
@stefanklein<https://github.com/stefanklein> Just a funny cosmetic thing here! Why would you do |= true on a bool variable, when you can simply do = true? At least it looks like it was you, with commit 93bd2b2<93bd2b2> (back in 2008)!
—
Reply to this email directly, view it on GitHub<#1501?email_source=notifications&email_token=AAF2LNMTE4H7LBMFPL3YRCD523X35A5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTMMBWGAYDKMJUGE32M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#pullrequestreview-6060051417>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAF2LNPOEBKLZM254A5PFVD523X35AVCNFSNUABEKJSXA33TNF2G64TZHM4TCNJYGY4TINB3JFZXG5LFHM3DMMBXGMZTGMRRG2QXMAQ>.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS<https://github.com/notifications/mobile/ios/AAF2LNLRXL7TTEX4KSMBYDD523X35A5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTMMBWGAYDKMJUGE32M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y> and Android<https://github.com/notifications/mobile/android/AAF2LNP7J5YRL25LZWCZFW3523X35A5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTMMBWGAYDKMJUGE32M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>. Download it today!
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Just for the sake of simplicity.
stochasticgradients |= trueis equivalent tostochasticgradients = trueanyway.