mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[PyTorch] Use uint32_t for ProcessedNode::num_outputs (#121335)
We already use uint32_t for indexing, and the notion of a single graph node with more than four billion outputs stretches credulity. Differential Revision: [D54598821](https://our.internmc.facebook.com/intern/diff/D54598821/) Pull Request resolved: https://github.com/pytorch/pytorch/pull/121335 Approved by: https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
ea8f6e2e54
commit
4c58f2b675
@ -938,9 +938,9 @@ class TORCH_API ProcessedNode {
|
||||
return values_[outputs_offset_ + i];
|
||||
}
|
||||
|
||||
size_t num_outputs() const {
|
||||
uint32_t num_outputs() const {
|
||||
DCHECK(fn_ != nullptr);
|
||||
return fn_->num_outputs();
|
||||
return static_cast<uint32_t>(fn_->num_outputs());
|
||||
}
|
||||
|
||||
C10_NODISCARD c10::ArrayRef<const IValue> outputs() const {
|
||||
|
Reference in New Issue
Block a user