Skip to content

Understanding shapes #755

Answered by zachgk
hmf asked this question in Q&A
Mar 17, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

The input is not specified when creating the linear blocks in net. Because inputs can be computed, we thought it would be too much work to have to type them for every block. So, the 8 you are looking at is the output of the first linear block.

The input is not determined until the call to net.initialize. At this point, it determines the input is of size 4 (with batch size 2) using x.getShape()

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hmf
Comment options

Answer selected by hmf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants