mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Add admonition about as_float_unchecked() (#141742)
Signed-off-by: Edward Z. Yang <ezyang@meta.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/141742 Approved by: https://github.com/bdhirsh
This commit is contained in:
committed by
PyTorch MergeBot
parent
d905f1350a
commit
5212ec3879
@ -99,7 +99,12 @@ class C10_API SymFloat {
|
||||
return ptr_;
|
||||
}
|
||||
|
||||
// UNSAFELY coerce this SymFloat into a double. You MUST have
|
||||
// established that this is a non-symbolic by some other means,
|
||||
// typically by having tested is_symbolic(). You will get garbage
|
||||
// from this function if is_symbolic()
|
||||
double as_float_unchecked() const {
|
||||
TORCH_INTERNAL_ASSERT_DEBUG_ONLY(!is_symbolic());
|
||||
return data_;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user