Skip to content

Commit

Permalink
Fix unbuilt status warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanradev93 committed Jun 3, 2024
1 parent af1b2e6 commit dcc4386
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bayesflow/experimental/networks/resnet/hidden_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,17 @@ def call(self, inputs: Tensor, **kwargs):
x = x + inputs
return self.activation_fn(x)

def build(self, input_shape):
super().build(input_shape)
self(keras.KerasTensor(input_shape))

def get_config(self):
config = super().get_config()
config.update({
"residual": self.residual,
"spectral_norm": self.spectral_norm,
"activation_fn": keras.saving.serialize_keras_object(self.activation_fn),
"dense_with_dropout": keras.saving.serialize_keras_object(self.dense_with_dropout)
"dense": keras.saving.serialize_keras_object(self.dense),
"dropout": keras.saving.serialize_keras_object(self.dropout)
})
return config
1 change: 1 addition & 0 deletions bayesflow/experimental/networks/resnet/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@ def __init__(

def call(self, inputs: Tensor, **kwargs):
return self.res_blocks(inputs, **kwargs)

0 comments on commit dcc4386

Please sign in to comment.