Skip to content

Commit

Permalink
Support logistic for vector data type.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 606812186
  • Loading branch information
tensorflower-gardener authored and TensorFlow MLIR Team committed Feb 14, 2024
1 parent 537d106 commit 4aedbe2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mhlo/transforms/map_mhlo_to_scalar_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,12 @@ inline Value mapMhloOpToStdScalarOp<mhlo::LogisticOp>(
Value expNegX = mapMhloOpToStdScalarOp<mhlo::ExpOp>(loc, resultTypes,
resultTypes, {{negX}}, b);

Value oneFloat = b->create<arith::ConstantOp>(loc, b->getF32FloatAttr(1.0));
Type type = getElementTypeOrSelf(resultTypes[0]);
Value oneFloat =
type.isa<ComplexType>()
? b->create<arith::ConstantOp>(loc, b->getF32FloatAttr(1.0))
: getConstantOrSplat(b, loc, resultTypes[0],
FloatAttr::get(type, 1.0f));
Value one = mapConvertOpToStdScalarOp(loc, resultTypes, resultTypes,
{oneFloat.getType()}, {{oneFloat}}, b);
Value oneAddExprNegX = mapMhloOpToStdScalarOp<mhlo::AddOp>(
Expand Down

0 comments on commit 4aedbe2

Please sign in to comment.