Skip to content

feat: add AveragePooling2D layer support to backend#267

Open
paramananda-15 wants to merge 1 commit intoc2siorg:mainfrom
paramananda-15:feat/add-averagepool-layer
Open

feat: add AveragePooling2D layer support to backend#267
paramananda-15 wants to merge 1 commit intoc2siorg:mainfrom
paramananda-15:feat/add-averagepool-layer

Conversation

@paramananda-15
Copy link
Copy Markdown
Contributor

Description

Adds support for the AveragePooling2D layer in the TensorMap backend model generation service.

This change allows ReactFlow graphs to include AveragePooling nodes that are translated into
tf.keras.layers.AveragePooling2D when constructing the Keras functional model.

The implementation adds handling for a new node type (customavgpool) in
app/services/model_generation.py, enabling TensorMap to support average pooling operations
commonly used in convolutional neural networks.

This contribution aligns with the TensorMap GSoC project goal of expanding the
supported layer types in the backend.

Fixes #N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

How Has This Been Tested?

All existing backend tests were executed locally after implementing the change
to ensure no regressions were introduced.

Command used:
python -m pytest

Results:
130 passed in ~3 seconds

  • Existing tests pass
  • New tests added
  • Manual testing

Screenshots (if applicable)

N/A

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review
  • I have added/updated documentation as needed
  • My changes generate no new warnings
  • Tests pass locally

@ivantha
Copy link
Copy Markdown
Member

ivantha commented Apr 13, 2026

The backend model generation code for AveragePooling2D looks correct, but this PR only implements the backend half of the feature. There is no matching frontend implementation (no customavgpool node component, no sidebar button, and no properties panel entry). Please add the corresponding frontend pieces so the layer is actually usable, then this can be merged.

@paramananda-15 paramananda-15 force-pushed the feat/add-averagepool-layer branch 2 times, most recently from 78864bc to 7c8c95d Compare April 14, 2026 07:54
feat: add AveragePooling2D frontend support

fix: sync package-lock.json with dependencies

fix: regenerate package-lock.json to match dependencies
@paramananda-15 paramananda-15 force-pushed the feat/add-averagepool-layer branch from a45a081 to 789f7ca Compare April 14, 2026 08:06
@paramananda-15
Copy link
Copy Markdown
Contributor Author

The backend model generation code for AveragePooling2D looks correct, but this PR only implements the backend half of the feature. There is no matching frontend implementation (no customavgpool node component, no sidebar button, and no properties panel entry). Please add the corresponding frontend pieces so the layer is actually usable, then this can be merged.

Added full stack support for AveragePooling2D:

  • Backend: model generation support
  • Frontend:
    • AvgPoolNode component
    • Sidebar entry (customavgpool)
    • Canvas integration
    • NodePropertiesPanel support

Also fixed CI issues (lock file + formatting) and squashed commits.

Ready for review.

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