Address with 'param not None' case

This commit is contained in:
peixu_ren 2020-09-02 14:32:15 -04:00
parent 290979853e
commit 21c663178c
2 changed files with 5 additions and 0 deletions

View File

@ -50,6 +50,8 @@ class Bijector(Cell):
self._parameters = {}
# parsing parameters
for k in param.keys():
if k == 'param':
continue
if not(k == 'self' or k.startswith('_')):
self._parameters[k] = param[k]
self._is_constant_jacobian = is_constant_jacobian

View File

@ -35,6 +35,9 @@ class PowerTransform(Bijector):
Args:
power (int or float): scale factor. Default: 0.
name (str): name of the bijector. Default: 'PowerTransform'.
param (dict): parameters used to initialize the bijector. This is only used when other bijectors that inherits
from powertransform passing in parameters. In this case the derived bijector may overwrite the param args.
Default: None.
Examples:
>>> # To initialize a PowerTransform bijector of power 0.5