Skip to content

[Ops] AvgPool2d - tensor error #2770

@kmilanovicTT

Description

@kmilanovicTT

Issue details

  • Test generated date: 2025-07-28
  • Test error message: E AssertionError: Setting a tensor value of incorrect shape: (12, 64, 157, 74) vs torch.Size([12, 64, 149, 82])
  • Failing reason: INCORRECT_TENSOR_SHAPE
  • Description: Incorrect tensor shape
  • Exception: AssertionError
  • Component: Forge

Summary

When testing pytorch AvgPool2d op, test cases are failing with error message described above

Reproduction steps (mlir)

  1. Checkout branch kmilanovic/bug_report_pytorch_avg_pool_2d

  2. To run all tests, run command:
    pytest -svv forge/test/mlir/operators/nn/test_nn.py::test_avg_pool_2d_with_tensor_error

  3. To run single test, run the following command, where the <configuration> is the configuration of the test:
    pytest -svv 'forge/test/mlir/operators/nn/test_nn.py::`<configuration>`'

Configurations

  test_avg_pool_2d_with_tensor_error[ModelFromAnotherOp-{'kernel_size': (16, 27), 'stride': 1, 'padding': (6, 2), 'ceil_mode': False, 'count_include_pad': True, 'divisor_override': None}-(12, 64, 160, 96)
  test_avg_pool_2d_with_tensor_error[ModelFromAnotherOp-{'kernel_size': (10, 17), 'stride': 1, 'padding': (2, 0), 'ceil_mode': False, 'count_include_pad': False, 'divisor_override': None}-(1, 32, 32, 64)
  test_avg_pool_2d_with_tensor_error[ModelFromAnotherOp-{'kernel_size': (26, 32), 'stride': (10, 9), 'padding': (10, 7), 'ceil_mode': False, 'count_include_pad': True, 'divisor_override': None}-(1, 100, 100, 100)
  test_avg_pool_2d_with_tensor_error[ModelDirect-{'kernel_size': (16, 27), 'stride': 1, 'padding': (6, 2), 'ceil_mode': False, 'count_include_pad': True, 'divisor_override': None}-(12, 64, 160, 96)
  test_avg_pool_2d_with_tensor_error[ModelDirect-{'kernel_size': (10, 17), 'stride': 1, 'padding': (2, 0), 'ceil_mode': False, 'count_include_pad': False, 'divisor_override': None}-(1, 32, 32, 64)
  test_avg_pool_2d_with_tensor_error[ModelDirect-{'kernel_size': (26, 32), 'stride': (10, 9), 'padding': (10, 7), 'ceil_mode': False, 'count_include_pad': True, 'divisor_override': None}-(1, 100, 100, 100)
  test_avg_pool_2d_with_tensor_error[ModelConstEvalPass-{'kernel_size': (16, 27), 'stride': 1, 'padding': (6, 2), 'ceil_mode': False, 'count_include_pad': True, 'divisor_override': None}-(12, 64, 160, 96)
  test_avg_pool_2d_with_tensor_error[ModelConstEvalPass-{'kernel_size': (10, 17), 'stride': 1, 'padding': (2, 0), 'ceil_mode': False, 'count_include_pad': False, 'divisor_override': None}-(1, 32, 32, 64)
  test_avg_pool_2d_with_tensor_error[ModelConstEvalPass-{'kernel_size': (26, 32), 'stride': (10, 9), 'padding': (10, 7), 'ceil_mode': False, 'count_include_pad': True, 'divisor_override': None}-(1, 100, 100, 100)

Notes

All test ids in test_plan generating this error can be found in file:
forge/test/operators/pytorch/ids/xfail/avg_pool_2d_incorrect_tensor_shape.txt

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions