From 97758862bddab54fe9ff89f4776bf82c3ba8ba10 Mon Sep 17 00:00:00 2001 From: marload Date: Sat, 11 Apr 2020 19:43:45 +0900 Subject: [PATCH] refactoring: early return 'if else' syntax -> 'if' syntax --- sonnet/src/bias.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sonnet/src/bias.py b/sonnet/src/bias.py index 536c743f..43eb33f4 100644 --- a/sonnet/src/bias.py +++ b/sonnet/src/bias.py @@ -125,8 +125,7 @@ def __call__(self, inputs: tf.Tensor, multiplier: types.FloatLike = None): self._initialize(inputs) if multiplier is not None: return inputs + (self.b * multiplier) - else: - return inputs + self.b + return inputs + self.b def calculate_bias_shape(input_shape: types.ShapeLike,