Skip to content

Fix TF 2.20 compatibility: enforce keyword-only non-tensor args in Keras layer call methods#690

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/refactor-kernel-calls-to-keyword-args
Closed

Fix TF 2.20 compatibility: enforce keyword-only non-tensor args in Keras layer call methods#690
Copilot wants to merge 3 commits intomainfrom
copilot/refactor-kernel-calls-to-keyword-args

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

  • Fix SharedMLP.call in randlanet.py - make training keyword-only
  • Fix LocalSpatialEncoding.call in randlanet.py - make training and relative_features keyword-only
  • Fix AttentivePooling.call in randlanet.py - make training keyword-only
  • Fix LocalFeatureAggregation.call in randlanet.py - make training keyword-only
  • Fix BatchNormBlock.call call sites in network_blocks.py - pass training as keyword
  • Fix UnaryBlock.call in network_blocks.py - make batch and training keyword-only
  • Fix SimpleBlock.call in network_blocks.py - make batch keyword-only; fix internal training calls
  • Fix ResnetBottleneckBlock.call in network_blocks.py - make batch keyword-only; fix all internal training/batch calls
  • Fix NearestUpsampleBlock.call in network_blocks.py - make batch keyword-only
  • Fix KPFCNN.call in kpconv.py - pass batch as keyword in all block calls; fix head_mlp/head_softmax calls
  • Fix PointPillarsScatter.call in point_pillars.py - make batch_size keyword-only; fix call site in extract_feats
  • Fix tf_batch_neighbors in kpconv.py - pass radius, points_row_splits, queries_row_splits as keywords to FixedRadiusSearch
  • Fix SECONDFPN in point_pillars.py - add Permute layers to convert NCHW↔NHWC around Conv2DTranspose/Conv2D to avoid channels_first unsupported on CPU
Original prompt

Update the codebase to resolve errors caused by TensorFlow 2.20's stricter API for argument passing in model and layer call methods. Specifically:

  • Refactor all custom Keras model and layer call methods (e.g., PointPillars, RandLANet, SharedMLP, KPConv) so that only the input tensor is accepted as a positional argument and all other arguments (like training, floats, ints, etc.) are keyword-only.
  • Audit all calls to layers/models (including Sequential) to ensure additional arguments are always passed via keywords, never positionally.
  • Update relevant tests (such as tests/test_models.py) to ensure model/layer calls use keyword arguments for parameters other than the primary input.
  • Verify the fixes by ensuring failing tests (test_pointpillars_tf, test_randlanet_tf, test_kpconv_tf) pass, specifically eliminating errors like: Only input tensors may be passed as positional arguments, and Layers added to a Sequential model can only have a single positional argument.

Apply these changes consistently throughout the codebase to restore full TensorFlow 2.20+ compatibility.

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: ssheorey <41028320+ssheorey@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Keras models for TensorFlow 2.20 API compliance Fix TF 2.20 compatibility: enforce keyword-only non-tensor args in Keras layer call methods Feb 23, 2026
Copilot AI requested a review from ssheorey February 23, 2026 18:27
@ssheorey
Copy link
Member

@copilot Check CI error and fix.

…st Conv2DTranspose

Co-authored-by: ssheorey <41028320+ssheorey@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 23, 2026

@copilot Check CI error and fix.

Fixed in commit 02c2dc9. Two CI failures were addressed:

  1. test_kpconv_tf: In tf_batch_neighbors, FixedRadiusSearch was called with r=0.15 (float) as a positional argument. Fixed by using keyword arguments: nns(points, queries, radius=r, points_row_splits=p_splits, queries_row_splits=q_splits).

  2. test_pointpillars_tf: SECONDFPN used Conv2DTranspose with data_format='channels_first' which is not supported on CPU in TF 2.20. Fixed by adding Permute((2,3,1)) (NCHW→NHWC) before and Permute((3,1,2)) (NHWC→NCHW) after each deblock's convolution, and changing the convolutions to data_format='channels_last'.

@ssheorey ssheorey closed this Feb 24, 2026
ssheorey added a commit that referenced this pull request Feb 25, 2026
Continued from copilot PR #690 

- Fix SharedMLP.call in randlanet.py - make training keyword-only
- Fix LocalSpatialEncoding.call in randlanet.py - make training and
relative_features keyword-only
- Fix AttentivePooling.call in randlanet.py - make training keyword-only
- Fix LocalFeatureAggregation.call in randlanet.py - make training
keyword-only
- Fix BatchNormBlock.call call sites in network_blocks.py - pass
training as keyword
- Fix UnaryBlock.call in network_blocks.py - make batch and training
keyword-only
- Fix SimpleBlock.call in network_blocks.py - make batch keyword-only;
fix internal training calls
- Fix ResnetBottleneckBlock.call in network_blocks.py - make batch
keyword-only; fix all internal training/batch calls
- Fix NearestUpsampleBlock.call in network_blocks.py - make batch
keyword-only
- Fix KPFCNN.call in kpconv.py - pass batch as keyword in all block
calls; fix head_mlp/head_softmax calls
- Fix PointPillarsScatter.call in point_pillars.py - make batch_size
keyword-only; fix call site in extract_feats
- Fix tf_batch_neighbors in kpconv.py - pass radius, points_row_splits,
queries_row_splits as keywords to FixedRadiusSearch
- Fix SECONDFPN in point_pillars.py - add Permute layers to convert
NCHW↔NHWC around Conv2DTranspose/Conv2D to avoid channels_first
unsupported on CPU

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Benjamin Ummenhofer <benjamin.ummenhofer@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants