singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [singa] dcslin commented on pull request #688: Autograd refactor
Date Wed, 06 May 2020 02:00:47 GMT

dcslin commented on pull request #688:

   > > changes:
   > > ```
   > > 1. an example of make `class Xxx(Operation)` to private `class _Xxx(Operation)`.
Because `class Operation` should be only for internal. For the term `Operation` in the user
space, it should be the operation functions `def xxx(x):...`. Also these operation function
should be used by the user
   > > 
   > > 2. fix bug for `set_param` when given Tensor as params
   > > 
   > > 3. Modified `Linear` constructor to `(self,out_features, in_features=None, bias=True):`.
`out_features` comes first, leaving `in_features` as optional. When `Linear` is constructed
with only `out_features`, it's params, `W` and `b`, are not initialized. After `set_params`
or `forward`/`__call__`,  it's params, `W` and `b`, are initialized.
   > > ```
   > For the last point, it will break the compatibility..
   > there are two solutions
   > 1. use *args and **kwargs
   > 2. assume the old code passes (in_features, out_features, bias=True) and the new code
passes (out_features, bias=True), then we check if in_features is None or not to decide the
argument order.
   > In V4, we can update the API completely.
   ok thanks.
   changes No.4: modified the `__ini__` to parse `*args and **kwargs` for Linear, RNN, LSTM

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:

View raw message