Skip to content

Conversation

@kaiyuan-li
Copy link
Contributor

@kaiyuan-li kaiyuan-li commented Oct 14, 2025

we don't need numpy as an extra dependency for just getting the prod of shape. Replaced with math.prod. Current test_utils.py covers the change.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 14, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the numpy dependency from the utils module by replacing np.prod with Python's built-in math.prod for calculating tensor shape products. This reduces external dependencies while maintaining the same functionality.

Key Changes

  • Added math module import
  • Removed numpy import and dependency
  • Replaced np.prod calls with math.prod in tensor size calculations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@kaiyuan-li kaiyuan-li merged commit 2a59413 into meta-pytorch:main Oct 15, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants