Skip to content

Understanding the tensor structure #108

Answered by jatkinson1000
NicoClinco asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @NicoClinco I'm guessing you're coming from python and are less familiar with Fortran? The line you quote declares an array of tensors. This is because fortran is more restrictive than python as a compiled language, so we need to do this for models that may have multiple tensor inputs.

Breaking it down, the statement says: "create a vector of torch_tensor types containing one item, and name it (the vector) in_tensor."

If you wanted to pass three different tensors to your model as inputs then you would declare it as dimension(3) etc.

Batch size would be part of the tensor you pass in as an element of this array. so if you had a single input to your net of length n, batch size m, you wou…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by TomMelt
Comment options

You must be logged in to vote
2 replies
@jatkinson1000
Comment options

@jatkinson1000
Comment options

Comment options

You must be logged in to vote
0 replies
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