Skip to content

fix: fix Axon.Display for Tensor parameter templates#638

Open
karlosmid wants to merge 1 commit into
elixir-nx:mainfrom
karlosmid:main
Open

fix: fix Axon.Display for Tensor parameter templates#638
karlosmid wants to merge 1 commit into
elixir-nx:mainfrom
karlosmid:main

Conversation

@karlosmid

@karlosmid karlosmid commented Jun 30, 2026

Copy link
Copy Markdown

Hi, thank you for this great library.
Doing examples in book Machine Learning in Elixir, I found out that this example is broken. This pr resolves this issue:

https://axon.hexdocs.pm/Axon.Display.html#as_table/2

Error was:

** (FunctionClauseError) no function clause matching in anonymous fn/2 in Axon.Display.do_axon_to_rows/6    
    
    The following arguments were given to anonymous fn/2 in Axon.Display.do_axon_to_rows/6:
    
        # 1
        %Axon.Parameter{
          name: "bias",
          template: #Nx.Tensor<
            f32[128]
            Nx.TemplateBackend
          >,
          shape: {128},
          initializer: #Function<23.85168475/2 in Axon.Initializers.zeros/0>,
          children: nil,
          type: {:f, 32},
          frozen: false,
          kind: :parameter
        }
    
        # 2
        100352
    
    (axon 0.8.1) lib/axon/display.ex:185: anonymous fn/2 in Axon.Display.do_axon_to_rows/6
    (elixir 1.19.3) lib/enum.ex:2520: Enum."-reduce/3-lists^foldl/2-0-"/3
    (axon 0.8.1) lib/axon/display.ex:185: Axon.Display.do_axon_to_rows/6
    (axon 0.8.1) lib/axon/display.ex:100: Axon.Display.axon_to_rows/6
    (axon 0.8.1) lib/axon/display.ex:172: anonymous fn/4 in Axon.Display.do_axon_to_rows/6
    (elixir 1.19.3) lib/enum.ex:1814: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3
    (axon 0.8.1) lib/axon/display.ex:169: Axon.Display.do_axon_to_rows/6
    #cell:oqd7d7vohmodx3zi:1: (file)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants