mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Revert "Add Accelerator device and shell hooks (#119329)"
This reverts commit 4b9568a360c4a90220e78e43435be8c56bc33fb2. Reverted https://github.com/pytorch/pytorch/pull/119329 on behalf of https://github.com/huydhn due to Breaks internal build and requires OSS file update to fix it ([comment](https://github.com/pytorch/pytorch/pull/119329#issuecomment-1940278598))
This commit is contained in:
@ -239,13 +239,9 @@ struct TORCH_API Node : std::enable_shared_from_this<Node> {
|
||||
* elements are on different devices (across multiple GPUs, for example)
|
||||
* they may have different streams.
|
||||
*/
|
||||
c10::optional<c10::Stream> stream() {
|
||||
auto opt_device_type = at::getAccelerator();
|
||||
if (!opt_device_type.has_value()) {
|
||||
return c10::nullopt;
|
||||
}
|
||||
c10::optional<c10::Stream> stream(const c10::DeviceType device_type) {
|
||||
for (const auto& metadata : input_metadata_) {
|
||||
if (metadata.device().type() == opt_device_type.value())
|
||||
if (metadata.device().type() == device_type)
|
||||
return metadata.stream();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user