Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3981,11 +3981,15 @@ bool UniformInplace_OpInferSymbolicShape(
return UniformInplaceOpInferSymbolicShape(op, infer_context);
}

// bool UniformRandomBatchSizeLikeOpInferSymbolicShape(
// pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) {
// // pass
// return true;
// }
bool UniformRandomBatchSizeLikeOpInferSymbolicShape(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for UniformRandomBatchSizeLikeOpInferSymbolicShape

pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) {
return BatchSizeLikeInferSymbolicShape(op, infer_context);
}

bool UniformRandomBatchSizeLikeSrOpInferSymbolicShape(
pir::Operation *op, pir::InferSymbolicShapeContext *infer_context) {
return UniformRandomBatchSizeLikeOpInferSymbolicShape(op, infer_context);
}

bool UniqueOpInferSymbolicShape(pir::Operation *op,
pir::InferSymbolicShapeContext *infer_context) {
Expand Down Expand Up @@ -4153,12 +4157,8 @@ bool UnsqueezeOpInferSymbolicShape(
int x_dims_size = x_sym_shape.size();

std::vector<symbol::DimExpr> axis_sym;
if (axis_shape_or_data.data().has_value()) {
axis_sym = axis_shape_or_data.data().value();
} else {
axis_sym =
details::GetOrCreateExprVecFromData(axis_shape_or_data, infer_context);
}
axis_sym =
details::GetOrCreateExprVecFromData(axis_shape_or_data, infer_context);
int axis_sym_size = axis_sym.size();

// GetUnsqueezeShape
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ OP_DECLARE_INFER_SYMBOLIC_SHAPE(TransLayout)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(Unbind)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(UniformInplace)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(UniformInplace_)
// OP_DECLARE_INFER_SYMBOLIC_SHAPE(UniformRandomBatchSizeLike)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(UniformRandomBatchSizeLike)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(UniformRandomBatchSizeLikeSr)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(Unique)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(UniqueConsecutive)
OP_DECLARE_INFER_SYMBOLIC_SHAPE(Unsqueeze)
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/ops/yaml/ops.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5173,7 +5173,7 @@
data_type: dtype
no_need_buffer: input
traits : pir::SideEffectTrait, paddle::dialect::ForwardOnlyTrait
# interfaces : paddle::dialect::InferSymbolicShapeInterface
interfaces : paddle::dialect::InferSymbolicShapeInterface

- op : unique_consecutive
args : (Tensor x, bool return_inverse = false, bool return_counts = false, int[] axis = {}, DataType dtype = DataType::FLOAT32)
Expand Down