There is no easy way to disable opt on part of the graph.
I think you can use x*(x<=a).astype('float32')
The cast will get merged by Theano with the comparisons and as all inputs
and outputs of that fused op are in float32, Theano should move that to the
GPU.
Fred
Le sam. 11 févr. 2017 06:51, Kiuhnm Mnhuik <[email protected]> a écrit :
> Is it possible to disable optimizations for a subgraph?
> For instance, I need to compute (a - b) + b which Theano would incorrectly
> simplify as a. I'm directly exploiting the characteristics of float32
> numbers.
>
> Basically, I'm doing boolean operations and comparisons directly in
> float32 because I need to do all the computation on the GPU (GTX 970).
> Whenever I use things like x * (x <= a) the data gets moved to the CPU.
> And no, I can't use the new backend because it simply doesn't work on my
> system.
>
> --
>
> ---
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
---
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 [email protected].
For more options, visit https://groups.google.com/d/optout.