dibgerge opened a new pull request #19721:
URL: https://github.com/apache/incubator-mxnet/pull/19721


   ## Description ##
   The `repr` of Distribution base class fails when any of its subclasses has 
one of its `arg_constraints` defined as `cached_property` which has not yet 
been initialized. This affects only Mxnet 2.
   
   Solves #19720 
   
   ## Checklist ##
   ### Essentials ###
   - [x] PR's title starts with a category (e.g. [BUGFIX], [MODEL], [TUTORIAL], 
[FEATURE], [DOC], etc)
   - [x ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage
   - [x ] Code is well-documented
   
   ### Changes ###
   - Uninitialized `cached_properties` will appear with size `None`. For 
example a `Categorical` distribution initialized with logit values, will show 
`prob` size as `None` untill `prob` is called.
   
   ```
   Categorical(prob: size None, logit: size (3,), F: mxnet.ndarray, event_dim: 
0)
   ```
   
   ## Comments ##
   - Another possible solution which doesn't need lots of code change is 
calling the uncached property within the `__repr__` method, which will force 
initialize it. 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to