Skip to content

Fix rename_feature skipping layer outputs when rename_inputs=False#2676

Merged
TobyRoseman merged 1 commit into
apple:mainfrom
eyupcanakman:fix/rename-feature-output-2494
Apr 28, 2026
Merged

Fix rename_feature skipping layer outputs when rename_inputs=False#2676
TobyRoseman merged 1 commit into
apple:mainfrom
eyupcanakman:fix/rename-feature-output-2494

Conversation

@eyupcanakman
Copy link
Copy Markdown
Contributor

rename_feature(..., rename_inputs=False, rename_outputs=True) on a neuralNetwork spec renames description.output but leaves the producing layer's output field unchanged. The model then fails to compile with "Interface specifies output X which is not produced by any layer in the neural network".

The if rename_outputs: branch sat inside if rename_inputs:, so the layer-output rename only ran when both flags were true. The fix moves the branch out one level so the two flags become independent.

Added test_rename_output_neural_network. test_rename_output next to it uses a glmRegressor spec, which never reaches the per-layer loop.

Fixes #2494

The if rename_outputs branch sat inside if rename_inputs, so the
layer-output rename only ran when both flags were true. Move the
branch out one level so the two flags become independent, matching
the documented behavior.

Fixes apple#2494
@TobyRoseman
Copy link
Copy Markdown
Collaborator

@TobyRoseman TobyRoseman merged commit 61202ea into apple:main Apr 28, 2026
@TobyRoseman
Copy link
Copy Markdown
Collaborator

Thanks @eyupcanakman for your contribution.

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.

rename_features bug

2 participants