diff options
author | 2018-05-09 23:21:19 -0700 | |
---|---|---|
committer | 2018-05-09 23:24:14 -0700 | |
commit | 11574c3b5aa8dbb9d7dbaf0e1b20ad3ae5a4bb46 (patch) | |
tree | 096f2c288fc4ad0986f742263bfe22fc80449a26 /tensorflow/compiler/xla/service/shape_inference.cc | |
parent | 8c747a1a8f8c78475c5d5d99d95509c836684dcf (diff) |
[XLA] Add log1p/expm1
A new HLO seems prudent as it allows implementations to use fancy techniques to
compute accurate results for small inputs.
PiperOrigin-RevId: 196078115
Diffstat (limited to 'tensorflow/compiler/xla/service/shape_inference.cc')
-rw-r--r-- | tensorflow/compiler/xla/service/shape_inference.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/service/shape_inference.cc b/tensorflow/compiler/xla/service/shape_inference.cc index c493547d9e..fedb42ac88 100644 --- a/tensorflow/compiler/xla/service/shape_inference.cc +++ b/tensorflow/compiler/xla/service/shape_inference.cc @@ -58,6 +58,8 @@ UnaryOperation OpcodeToUnaryOperation(HloOpcode opcode) { return UNOP_COS; case HloOpcode::kExp: return UNOP_EXP; + case HloOpcode::kExpm1: + return UNOP_EXPM1; case HloOpcode::kFloor: return UNOP_FLOOR; case HloOpcode::kImag: @@ -66,6 +68,8 @@ UnaryOperation OpcodeToUnaryOperation(HloOpcode opcode) { return UNOP_IS_FINITE; case HloOpcode::kLog: return UNOP_LOG; + case HloOpcode::kLog1p: + return UNOP_LOG1P; case HloOpcode::kNot: return UNOP_NOT; case HloOpcode::kNegate: @@ -337,7 +341,9 @@ StatusOr<Shape> InferWindowOutputShape(const Shape& base_shape, case UNOP_COS: case UNOP_SIN: case UNOP_EXP: + case UNOP_EXPM1: case UNOP_LOG: + case UNOP_LOG1P: case UNOP_TANH: if (!ShapeUtil::ElementIsFloating(arg) && !ShapeUtil::ElementIsComplex(arg)) { |