forked from mindspore-Ecosystem/mindspore
clean the warning code
This commit is contained in:
parent
5c72a3c2bc
commit
77769f2a41
|
@ -190,7 +190,7 @@ class Bijector(Cell):
|
|||
"""
|
||||
if 'param_dict' not in self.parameters.keys():
|
||||
return None
|
||||
param_dict = self.parameters['param_dict']
|
||||
param_dict = self.parameters.get('param_dict')
|
||||
broadcast_shape_tensor = None
|
||||
for value in param_dict.values():
|
||||
if value is None:
|
||||
|
@ -208,7 +208,7 @@ class Bijector(Cell):
|
|||
"""
|
||||
if 'param_dict' not in self.parameters.keys():
|
||||
return False
|
||||
param_dict = self.parameters['param_dict']
|
||||
param_dict = self.parameters.get('param_dict')
|
||||
for value in param_dict.values():
|
||||
if value is None:
|
||||
continue
|
||||
|
@ -327,4 +327,4 @@ class Bijector(Cell):
|
|||
return self.forward_log_jacobian(*args, **kwargs)
|
||||
if name == 'inverse_log_jacobian':
|
||||
return self.inverse_log_jacobian(*args, **kwargs)
|
||||
return None
|
||||
raise Exception('Invalid name')
|
||||
|
|
|
@ -218,7 +218,7 @@ class Distribution(Cell):
|
|||
"""
|
||||
Check if the parameters used during initialization are scalars.
|
||||
"""
|
||||
param_dict = self.parameters['param_dict']
|
||||
param_dict = self.parameters.get('param_dict')
|
||||
for value in param_dict.values():
|
||||
if value is None:
|
||||
continue
|
||||
|
|
|
@ -67,10 +67,10 @@ class Gumbel(TransformedDistribution):
|
|||
TypeError: When the input `dtype` is not a subclass of float.
|
||||
|
||||
Examples:
|
||||
>>> import numpy as np
|
||||
>>> import mindspore
|
||||
>>> import mindspore.nn as nn
|
||||
>>> import numpy as np
|
||||
>>> import mindspore.nn.probability.distribution as msd
|
||||
>>> import mindspore.nn as nn
|
||||
>>> from mindspore import Tensor
|
||||
>>> class Prob(nn.Cell):
|
||||
... def __init__(self):
|
||||
|
|
Loading…
Reference in New Issue