diff --git a/torch/csrc/stable/accelerator.h b/torch/csrc/stable/accelerator.h index 879080237b4..b73b27936ea 100644 --- a/torch/csrc/stable/accelerator.h +++ b/torch/csrc/stable/accelerator.h @@ -1,11 +1,12 @@ #pragma once #include +#include #include #include -namespace torch::stable::accelerator { +HIDDEN_NAMESPACE_BEGIN(torch, stable, accelerator) using DeleterFnPtr = void (*)(void*); @@ -75,4 +76,4 @@ inline DeviceIndex getCurrentDeviceIndex() { return device_index; } -} // namespace torch::stable::accelerator +HIDDEN_NAMESPACE_END(torch, stable, accelerator) diff --git a/torch/csrc/stable/ops.h b/torch/csrc/stable/ops.h index 0fbd9210be2..467bbabb501 100644 --- a/torch/csrc/stable/ops.h +++ b/torch/csrc/stable/ops.h @@ -9,8 +9,9 @@ #include #include +#include -namespace torch::stable { +HIDDEN_NAMESPACE_BEGIN(torch, stable) // We expect this to be the stable version of the empty_like op that takes in // no kwargs (device, dtype, layout, memory_format). We will add kwargs @@ -244,4 +245,4 @@ inline torch::stable::Tensor clone(const torch::stable::Tensor& self) { return torch::stable::detail::to(stack[0]); } -} // namespace torch::stable +HIDDEN_NAMESPACE_END(torch, stable) diff --git a/torch/csrc/stable/stableivalue_conversions.h b/torch/csrc/stable/stableivalue_conversions.h index 4aa96337be1..044d31d119c 100644 --- a/torch/csrc/stable/stableivalue_conversions.h +++ b/torch/csrc/stable/stableivalue_conversions.h @@ -4,12 +4,13 @@ #include #include #include +#include #include #include #include -namespace torch::stable::detail { +HIDDEN_NAMESPACE_BEGIN(torch, stable, detail) // forward declare so that the from/to() implementations in the detail // namespace of library.h where the real work is done can compile. @@ -335,7 +336,7 @@ inline T to(StableIValue val) { return detail::ToImpl::call(val); } -} // namespace torch::stable::detail +HIDDEN_NAMESPACE_END(torch, stable, detail) // [global from/to deprecation note] // WARNING! the following APIs will be removed!! We deprecated global from/to diff --git a/torch/csrc/stable/tensor_inl.h b/torch/csrc/stable/tensor_inl.h index f8461d93aff..37582de2018 100644 --- a/torch/csrc/stable/tensor_inl.h +++ b/torch/csrc/stable/tensor_inl.h @@ -8,9 +8,10 @@ #include #include #include +#include #include -namespace torch::stable { +HIDDEN_NAMESPACE_BEGIN(torch, stable) using torch::headeronly::ScalarType; @@ -21,4 +22,4 @@ inline ScalarType Tensor::scalar_type() const { torch::stable::detail::from(dtype)); } -} // namespace torch::stable +HIDDEN_NAMESPACE_END(torch, stable) diff --git a/torch/csrc/stable/tensor_struct.h b/torch/csrc/stable/tensor_struct.h index 568f52dc192..88cc167e597 100644 --- a/torch/csrc/stable/tensor_struct.h +++ b/torch/csrc/stable/tensor_struct.h @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -9,7 +10,7 @@ #include -namespace torch::stable { +HIDDEN_NAMESPACE_BEGIN(torch, stable) using accelerator::DeviceIndex; using torch::headeronly::ScalarType; @@ -168,4 +169,4 @@ class Tensor { // ============================================================================= }; -} // namespace torch::stable +HIDDEN_NAMESPACE_END(torch, stable)