Broadcast array on specific indices only #18400
Answered
by
soraros
jstpierref
asked this question in
Q&A
-
While doing a convolution with
It's nothing critical, but I'm looking for ideas to achieve this in functional ways. I tried things with If that matters, I'm on Apple M1 Pro running with |
Beta Was this translation helpful? Give feedback.
Answered by
soraros
Nov 6, 2023
Replies: 1 comment 1 reply
-
Try these: A = jnp.array([[-1, -1, -1], [-1, 16, -1], [-1, -1, -1]]) / 8.0
I = jnp.eye(3)
k0 = jnp.tensordot(A, I, axes=((), ()))
k1 = jnp.einsum('ij,kl->ijkl', A, I) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jstpierref
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try these: