-
Notifications
You must be signed in to change notification settings - Fork 180
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
'fuse_conv_bn_weights' and 'fuse_linear_bn_weights' in 'torch.nn.utils' #1262
Conversation
Actually I’ve also tried to implement |
That is a best practice, but one that we haven't always followed, and the existing tests aren't always "high coverage." I will be reluctant to merge without some tests. It's a little bit complicated to add a new file, so just find a test file with similar functionality and add tests there.
That depends on how many there are -- if there's just one or two, let a surrounding dispose scope take care of it. If there's more than just a couple, then place a dispose scope at the beginning and escape the function result when it's returned. In a few rare cases, such as when there's a loop and temporaries are created in the body of the loop, you should place a dispose scope inside the loop, too.
Yes. This is another area where we haven't been consistent. Explicit argument checking is always better, since the error message can be more precise and actionable. Also, please edit the RELEASENOTES.md file. If the top release heading is what is current on NuGet, then add a new release. There should be a 'Fixed Bugs' heading, and an 'API Changes' heading. Place a '<br/>' after each item in any list of additions/fixes (GH's MD renderer won't separate the lines without it). |
Yes, sure, a unit test to show the methods could work in most ordinary cases is necessary. I will mark this as a draft until the things mentioned above have been completed. |
|
From the CI/CD build:
|
I'm not sure what's happening. It definitely could work on my laptop. Maybe I should have some extra commits to test CI/CD's behavior. |
oh.. that is the collection expression seeming to be unsupported. but why my visual studio allows that... |
Yeah, we need to support both .NET FX 4.7.2 and .NET 6.0, so you have to stick to some lowest common denominators. |
And what about the build failure that still exists in |
That one is not your fault. I have a fix coming for that -- we updated the reference to ImageSharper in one of the examples, and it no longer supports .NET FX. That breakage will not block the merge of this PR. |
Hello! I've tried to add two methods
fuse_conv_bn_weights
andfuse_linear_bn_weights
intorch.nn.utils
.Since it's my first pull request that modifies the code, could someone please give me some advice? In fact I'm not sure about the following things:
clip_grad_value_
does not have a related unit test, andparameters_to_vector
's tests are placed inTestTorchSharp
and namedUtilsPtoV
, so I'm a bit confused with that.torchaudio.transform
. Meanwhile most functions just invoke the native code and returns the result without any extra tensors. So I'm not sure whethertorchaudio
is an exception or it is recommend to leave these tensors aside.