mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Dispatch the selection function to prevent using `is_mps()` in `Histogram.cpp`. <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at b329a02</samp> This pull request refactors and implements the logic for inferring the bin edges of histograms from the input tensor for different device types. It introduces a dispatch stub `histogram_select_outer_bin_edges_stub` and moves the device-specific code to separate files, such as `HistogramKernel.cpp` and `HistogramKernel.mm`. This improves the modularity and readability of the histogram functions. Pull Request resolved: https://github.com/pytorch/pytorch/pull/101792 Approved by: https://github.com/albanD