Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdf837d0

Browse files
vorsfacebook-github-bot
authored andcommitted
Use the libc++ detection instead of clang detection around std:isinfinite (#52164)
Summary:Fixes#52163The libc++ vs libstdc++ detection in the pre-processor is taken fromhttps://stackoverflow.com/questions/31657499/how-to-detect-stdlib-libc-in-the-preprocessorNote that in our case `std:isinfinite` presents means that we don't need to import any additional headers to guarantee the `_LIBCPP_VERSION` presents for the `libc++`.Pull Requestresolved:#52164Reviewed By: albanDDifferential Revision: D26413108Pulled By: malfetfbshipit-source-id: 515e258d6758222c910ababf5172c3a275aff08f
1 parentcd46ee6 commitdf837d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎aten/src/ATen/native/cpu/MultinomialKernel.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ void multinomial_with_replacement_apply(
4747
for (int64_t j =0; j < n_categories; j++) {
4848
val = self_ptr[i * self_stride_0 + j * self_stride_1];
4949
TORCH_CHECK(val >=0,"invalid multinomial distribution (encountering probability entry < 0)");
50-
// NB: std::isfinite doesn't bode well withclang for half datatypes,
50+
// NB: std::isfinite doesn't bode well withlibc++ for half datatypes,
5151
// so we manually cast it to a double and perform the check.
52-
#if defined(__clang__)
52+
#if defined(_LIBCPP_VERSION)
5353
TORCH_CHECK(std::isfinite(static_cast<double>(val)),
5454
"invalid multinomial distribution (encountering probability entry = infinity or NaN)");
5555
#else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp