-
Notifications
You must be signed in to change notification settings - Fork 6.8k
#13441 [Clojure] Add Spec Validations for the Random namespace #13523
Conversation
Thanks @hellonico ! I'll take a look shortly |
Thanks for making this better! I ran some of the examples and found some bugs with the improved validation: In Would you mind correcting the problems in the example as well? Thanks 💯 |
having a look ... |
I see. 1/ The first one is due to the spec below:
while the received parameter for the optimizer is: (note the 10 instead of 10.0)
If I make sure we cast to float all the different parameters, I can make the specs to be more flexible with:
That works ? 2/ Second one is
Where the dev should be passed inside the map (as I understand it) and which probably means the context was being ignored. Is that ok to change the examples to use a map for the context ? |
It's definitely fine to change the example to make it work correctly :) I'm ok with either changing the example code to be a float or we can think about loosening the spec to be a |
a153e18
to
93001cc
Compare
number? was a better choice, and is nicer to the user.
I am glad you agreed ;) |
Thanks @hellonico for your work in improving this. I ran through the examples and everything looks good. It is good to go when CI is green. |
* upstream/master: (54 commits) Add notes about debug with libstdc++ symbols (apache#13533) add cpp example inception to nightly test (apache#13534) Fix exception handling api doc (apache#13519) fix link for gluon model zoo (apache#13583) ONNX import/export: Size (apache#13112) Update MXNetTutorialTemplate.ipynb (apache#13568) fix the situation where idx didn't align with rec (apache#13550) Fix use-before-assignment in convert_dot (apache#13511) License update (apache#13565) Update version to v1.5.0 including clojure package (apache#13566) Fix flaky test test_random:test_randint_generator (apache#13498) Add workspace cleaning after job finished (apache#13490) Adding test for softmaxoutput (apache#13116) apache#13441 [Clojure] Add Spec Validations for the Random namespace (apache#13523) Revert "Bumped minor version from 1.4.0 to 1.5.0 on master, updated License file" (apache#13558) Chi_square_check for discrete distribution fix (apache#13543) Updated docs for randint operator (apache#13541) Simplifications and some fun stuff for the MNIST Gluon tutorial (apache#13094) Fix apache#13521 (apache#13537) Add a retry to qemu_provision (apache#13551) ...
Description
[Clojure] Add Spec Validations for the Random namespace
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
optimizer.clj: fix a previously added spec
random.clj: added clojure specs
operator_test.clj: expect ctx to be in a map
random_test.clj: update context key to ctx, added tests for random/normal, random/uniform and random/seed