Skip to content

Commit fd2862d

Browse files
committed
Slight doc change helpers
1 parent 15c964c commit fd2862d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

bayesflow/helper_classes.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ def __call__(self, batch_in):
9595
forward_dict[key_none] = None
9696
return forward_dict
9797

98+
def __len__(self):
99+
return len(self.data)
100+
98101
def __iter__(self):
99102
return map(self, self.data)
100103

bayesflow/helper_functions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828

2929

3030
def check_tensor_sanity(tensor, logger):
31-
"""Tests for the present of NaNs and Infs in a tensor."""
31+
"""Tests for the presence of NaNs and Infs in a tensor."""
32+
3233
if tf.executing_eagerly():
3334
if tf.reduce_any(tf.math.is_nan(tensor)):
3435
num_na = tf.reduce_sum(tf.cast(tf.math.is_nan(tensor), tf.int8)).numpy()

0 commit comments

Comments
 (0)