In the make_node of those op, you can put a "tag" to the output variable
and when DebugMode will see that tag, it will call it for comparison
instead of the default comparison. Then you can compare as you wish.

def your_comparison_fct(val1, val2):
   #compare the output of your op in a meaningful way.
   return True or False

def make_node(...):
   output_var=...
   output_var.tag.values_eq_approx = your_comparison_fct
   return Apply(self, inputs, [output_var])

This should do it.

Fred

On Sat, May 20, 2017 at 12:23 AM Gabe Schwartz <[email protected]> wrote:

> Hello,
> I'm working on creating a few theano Ops, one of which is a GPU hashtable.
> Due
> to some details in how it gets built, applying the op twice to the same
> inputs
> can generate different outputs Despite this, the two resulting tables are
> functionally the same.
>
> Right now, the merge optimizer successfully merges two Apply instances for
> hashtables created from identical inputs, and everything is fine. If run
> w/mode=DebugMode though, theano raises an exception when the merge
> optimizer
> changes the order of the bucket IDs. Is there a way to signal to the merge
> optimizer that it's OK for outputs to be different, or to give it a way to
> compare the
> outputs and check if they are really "equal" (making sure the two tables
> contain the
> same keys)?
>
> --
>
> ---
> 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.

Reply via email to