Here's what my code in numpy looks like:

tensor = shared(np.random.randn(7, 16, 16))

e_tensor = tensor.eval()

tensor2 = e_tensor[0,:,:]
tensor2[tensor2 < 1] = 0.0
tensor2[tensor2 > 0 = 1.0

new_tensor = [tensor2]
for i in range(1, e_tensor.shape[0]):
    new_tensor.append(np.multiply(tensor2, e_tensor[i,:,:]))

output = np.array(new_tensor).reshape(7,16,16)




On Tuesday, January 17, 2017 at 10:47:24 AM UTC-5, Corey Nolet wrote:
>
> I have a tensor which is (7,16,16), let's denote as Tijk. I need to make 
> the following function:
>
> for j in range(0, 16):
>     for k in range(0, 16):
>         if T0jk == 0:
>             for i in range(1, 7):
>                 Tijk = 0
>
>
> Any ideas on how this can be done with Theano's tensor API?
>
>
> Thanks! :
>     
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to theano-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to