Skip to content

Commit 61368b2

Browse files
Justin Lebartensorflower-gardener
authored andcommitted
[XLA] Use IsInf function in implementation of lgamma.
PiperOrigin-RevId: 235275004
1 parent fa4eb70 commit 61368b2

File tree

1 file changed

+1
-3
lines changed
  • tensorflow/compiler/xla/client/lib

1 file changed

+1
-3
lines changed

tensorflow/compiler/xla/client/lib/math.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,7 @@ XlaOp Lgamma(XlaOp input) {
402402

403403
// lgamma(+/-inf) = +inf.
404404
XlaOp inf_bcast = FullLike(input, std::numeric_limits<float>::infinity());
405-
return Select(Or(IsFinite(input), // is finite, or
406-
Not(Or(Lt(input, one), Ge(input, one)))), // is nan
407-
result, inf_bcast);
405+
return Select(IsInf(input), inf_bcast, result);
408406
};
409407

410408
auto& b = *input.builder();

0 commit comments

Comments
 (0)