|
|
|
@@ -192,8 +192,8 @@ class FTRL(Optimizer): |
|
|
|
if not isinstance(value, str): |
|
|
|
raise TypeError("The value must be str type, but got value type is {}".format(type(value))) |
|
|
|
|
|
|
|
if value not in ('CPU', 'Ascend'): |
|
|
|
raise ValueError("The value must be 'CPU' or 'Ascend', but got value {}".format(value)) |
|
|
|
if value not in ('CPU', 'Ascend', 'GPU'): |
|
|
|
raise ValueError("The value must be 'CPU', 'Ascend' or 'GPU', but got value {}".format(value)) |
|
|
|
|
|
|
|
if value == 'CPU': |
|
|
|
self.sparse_opt = P.FusedSparseFtrl(self.lr, self.l1, self.l2, self.lr_power, self.use_locking) |
|
|
|
|