Skip to content

Commit

Permalink
TST: Add tests for log_diff_exp
Browse files Browse the repository at this point in the history
  • Loading branch information
Smit-create committed Jan 20, 2023
1 parent 0091f18 commit a05de4a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/tensor/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -3521,3 +3521,16 @@ def test_infer_shape(self):
[x1, x2],
self.op_class,
)

def test_logdiffexp():
x = fmatrix()
y = fmatrix()
f = function([x, y], log(exp(x) - exp(y)))
graph = f.maker.fgraph.toposort()
ops_graph = [
node
for node in graph
if isinstance(node.op, Elemwise)
and isinstance(node.op.scalar_op, aes.Exp)
]
assert len(ops_graph) == 0

0 comments on commit a05de4a

Please sign in to comment.