Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bayesflow/networks/consistency_models/consistency_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(
self.s0 = float(s0)
self.s1 = float(s1)
# create variable that works with JIT compilation
self.current_step = self.add_weight(name="current_step", initializer="zeros", trainable=False, dtype="int32")
self.current_step = self.add_weight(name="current_step", initializer="zeros", trainable=False, dtype="int")
self.current_step.assign(0)

self.seed_generator = keras.random.SeedGenerator()
Expand Down Expand Up @@ -258,7 +258,7 @@ def compute_metrics(self, x: Tensor, conditions: Tensor = None, stage: str = "tr
self.current_step.assign(ops.minimum(self.current_step, self.total_steps - 1))

discretization_index = ops.take(
self.discretization_map, ops.cast(self._schedule_discretization(self.current_step), "int32")
self.discretization_map, ops.cast(self._schedule_discretization(self.current_step), "int")
)
discretized_time = ops.take(self.discretized_times, discretization_index, axis=0)

Expand Down
4 changes: 2 additions & 2 deletions bayesflow/networks/coupling_flow/permutations/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def build(self, xz_shape: Shape, **kwargs) -> None:
shape=(xz_shape[-1],),
initializer=keras.initializers.Constant(forward_indices),
trainable=False,
dtype="int32",
dtype="int",
)

self.inverse_indices = self.add_weight(
shape=(xz_shape[-1],),
initializer=keras.initializers.Constant(inverse_indices),
trainable=False,
dtype="int32",
dtype="int",
)
4 changes: 2 additions & 2 deletions bayesflow/networks/coupling_flow/permutations/swap.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def build(self, xz_shape: Shape, **kwargs) -> None:
shape=(xz_shape[-1],),
initializer=keras.initializers.Constant(forward_indices),
trainable=False,
dtype="int32",
dtype="int",
)

self.inverse_indices = self.add_variable(
shape=(xz_shape[-1],),
initializer=keras.initializers.Constant(inverse_indices),
trainable=False,
dtype="int32",
dtype="int",
)
Loading