Add checks in ReduceWindowOpOnTensorsConversion.
The pattern does not support ops with non-zero padding config. Add a check to prevent unexpected lowering. It is not easy to add tests because other patterns will convert body ops, and it causes issues like invalid IRs. PiperOrigin-RevId: 367202450
This commit is contained in:
		
							parent
							
								
									c6894333b9
								
							
						
					
					
						commit
						c466f08993
					
				|  | @ -1712,6 +1712,10 @@ struct ReduceWindowOpOnTensorsConversion | |||
|       return rewriter.notifyMatchFailure(op, "expected NHWC pooling-based op"); | ||||
|     } | ||||
| 
 | ||||
|     if (op.padding() && !isSplatValue(*op.padding(), 0)) { | ||||
|       return rewriter.notifyMatchFailure(op, "require paddings are all zero"); | ||||
|     } | ||||
| 
 | ||||
|     SmallVector<int64_t, 2> shapes; | ||||
|     shapes.push_back(op.window_dimensions().getValue<int64_t>(1)); | ||||
|     shapes.push_back(op.window_dimensions().getValue<int64_t>(2)); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue