Why are we calling the for loop
for l in range(1, L):
instead of:
for l in range(L)
many tks
Why are we calling the for loop
for l in range(1, L):
instead of:
for l in range(L)
many tks
You just have to work out what is happening. What is the value of L in this instance? Your second loop will have one more iteration than the earlier one. How many are actually required? Add some print statements in the loop to watch what is happening with the layer numbers.
In addition to Paul’s response, also check this thread which discusses why we are using range(1, L)
.
Best,
Saif.