Skip to content

Commit

Permalink
flatten out the inner layers in model_to_load
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonmr committed Apr 30, 2021
1 parent 2e3d670 commit 76cb8ea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion anvil/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,12 @@ def model_to_load(_normalising_flow):
``anvil-train`` will also provide the same information.
"""
return layers.Sequential(*_normalising_flow)
# assume that _normalising_flow is a list of layers, each layer
# is a sequential of blocks, each block is a pair of transformations
# which transforms the entire input state - flatten this out, so output
# is Sequential of blocks
flow_flat = [block for layer in _normalising_flow for block in layer]
return layers.Sequential(*flow_flat)

# Update docstring above if you add to this!
LAYER_OPTIONS = {
Expand Down

0 comments on commit 76cb8ea

Please sign in to comment.