Skip to content

Commit da3c49e

Browse files
committed
add blank lines after doc strings
1 parent 6585da2 commit da3c49e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

rasa/utils/tensorflow/layers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def dropped_inputs() -> tf.Tensor:
3333

3434

3535
class DenseForSparse(tf.keras.layers.Dense):
36-
"""Dense layer for sparse input tensor"""
36+
"""Dense layer for sparse input tensor."""
3737

3838
def __init__(self, reg_lambda: float = 0, **kwargs) -> None:
3939
if reg_lambda > 0:
@@ -171,6 +171,7 @@ def call(
171171
training: Optional[Union[tf.Tensor, bool]] = None,
172172
) -> Tuple[tf.Tensor, tf.Tensor]:
173173
"""Randomly mask input sequences."""
174+
174175
if training is None:
175176
training = K.learning_phase()
176177

@@ -279,6 +280,7 @@ def _make_flat(x: tf.Tensor) -> tf.Tensor:
279280
def _random_indices(self, batch_size: tf.Tensor, total_candidates: tf.Tensor):
280281
def rand_idxs():
281282
"""Create random tensor of indices"""
283+
282284
# (1, num_neg)
283285
return tf.expand_dims(
284286
tf.random.shuffle(tf.range(total_candidates))[: self.num_neg], 0
@@ -450,7 +452,7 @@ def _train_sim(
450452

451453
@staticmethod
452454
def _calc_accuracy(sim_pos: tf.Tensor, sim_neg: tf.Tensor) -> tf.Tensor:
453-
"""Calculate accuracy"""
455+
"""Calculate accuracy."""
454456

455457
max_all_sim = tf.reduce_max(tf.concat([sim_pos, sim_neg], -1), -1)
456458
return tf.reduce_mean(

0 commit comments

Comments
 (0)