0

I have a large number of neural networks (such that I have to use list comprehension to produce them), say [f_1, f_2, f_3 ...], collectively denoted by F.

I have the argument X = [x_1, x_2, x_3 ...], such that input tensor x_i is intended for the network f_i. The tensors I have will be big, owing to the data and then the gradients.

Is there an elegant (and efficient) way of obtaining the sequence [f_1(x_1), f_2(x_2), f_3(x_3) ...]?

1 Answer 1

2

You could again use a list comprehension:

out = [f(x) for f,x in zip(F,X)]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.