5852 fixes partial callable config parser#5854
Conversation
9212e2b to
c71db74
Compare
c71db74 to
4093707
Compare
|
/build |
Signed-off-by: Wenqi Li <[email protected]>
- update test cases Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
88babdd to
ac26db9
Compare
|
/build |
|
This doesn't cover the following case where the model is an instantiated object and not a partial function. Picked EfficientNetBN for no particular reason. I've changed |
|
thanks @ibro45, in that case we still need the "fwd": {"_target_": "[email protected]", "inputs": "$torch.rand(1, 3, 256, 256)"},also because an instance of EfficientNetBN is also a callable, Please feel free to make a PR to add more test cases if you are interested :) |
|
@wyli when you parse the config it returns a partial function that you then manually call here Reproduceconfig.yaml: Run Run Do you agree that the ReasoningI want to call a method using This allows you to pass the arguments from CLI at the expense of making it very cluttered.
|
|
This seems like a helpful feature to me as well! Having the ability to both call a function through instantiate and create a partial function. I would've expected the default config to call the function because I mostly worked with hydra and am used to that being their default behavior. |
|
I think |
Signed-off-by: Wenqi Li [email protected]
Fixes #5852
Description
with an error message:
because
math.iscloseis a builtin type but not a function:the
partialshould supportcallableincluding builtin functions_target_of reference object's methods such as partial init:Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests --disttests.make htmlcommand in thedocs/folder.