Skip to content

Commit 1edcca3

Browse files
committed
[Fixup!] Some small minor manual const& fixes
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 14e3547 Pull Request resolved: #53471
1 parent 769418d commit 1edcca3

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

aten/src/ATen/native/TensorAdvancedIndexing.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ using scatter_add_fn = void(*)(Tensor& self, int64_t dim, const Tensor& index, c
2828
using scatter_reduce_fn = void(*)(Tensor& self, const int64_t dim, const Tensor& index,
2929
const Tensor& src, const SCATTER_GATHER_OP& reduce);
3030
using scatter_scalar_reduce_fn = void(*)(Tensor& self, const int64_t dim, const Tensor& index,
31-
Scalar& value, const SCATTER_GATHER_OP& reduce);
31+
const Scalar& value, const SCATTER_GATHER_OP& reduce);
3232

3333
DECLARE_DISPATCH(index_fn, index_stub);
3434
DECLARE_DISPATCH(index_fill_fn, index_fill_stub);

aten/src/ATen/native/cpu/FillKernel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void fill_non_native_type(TensorIterator& iter, const Scalar& value_scalar) {
2424
}
2525

2626
template <>
27-
void fill_non_native_type<c10::complex<at::Half>>(TensorIterator& iter, Scalar value_scalar) {
27+
void fill_non_native_type<c10::complex<at::Half>>(TensorIterator& iter, const Scalar& value_scalar) {
2828
static_assert(sizeof(c10::complex<at::Half>) == sizeof(int32_t), "Size of ComplexHalf should be 32-bits");
2929
auto value = c10::complex<at::Half>(value_scalar.to<c10::complex<float>>());
3030
auto val = *reinterpret_cast<int32_t*>(std::addressof(value));

aten/src/ATen/native/cpu/ScatterGatherKernel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ template <bool is_scatter_like = true>
101101
struct cpu_scatter_gather_base_kernel {
102102
template <typename func_t>
103103
void operator()(Tensor& self, int64_t dim,
104-
const Tensor& index, Scalar& value,
104+
const Tensor& index, const Scalar& value,
105105
const std::string& method_name, func_t& kernel_func) {
106106
// no-op if index is empty
107107
if (index.numel() == 0) {
@@ -338,7 +338,7 @@ void scatter_reduce_cpu_kernel(Tensor& self, const int64_t dim, const Tensor& in
338338
}
339339

340340
void scatter_scalar_reduce_cpu_kernel(Tensor& self, const int64_t dim, const Tensor& index,
341-
Scalar& value, const SCATTER_GATHER_OP& reduce) {
341+
const Scalar& value, const SCATTER_GATHER_OP& reduce) {
342342
switch (reduce) {
343343
case SCATTER_GATHER_OP::REDUCE_ADD :
344344
cpu_scatter_gather_base_kernel<>()(self, dim, index, value,

aten/src/ATen/native/cuda/ScatterGatherKernel.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ void scatter_reduce_cuda_kernel(Tensor& self, const int64_t dim, const Tensor& i
474474
}
475475

476476
void scatter_scalar_reduce_cuda_kernel(Tensor& self, const int64_t dim, const Tensor& index,
477-
Scalar& value, const SCATTER_GATHER_OP& reduce) {
477+
const Scalar& value, const SCATTER_GATHER_OP& reduce) {
478478
switch (reduce) {
479479
case SCATTER_GATHER_OP::REDUCE_ADD :
480480
cuda_scatter_fill_base_kernel<false>()(self, dim, index, value,

aten/src/ATen/native/quantized/cpu/quantized_ops.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ using qthreshold_fn = void (*)(
2727
using qtanh_fn = void (*)(const at::Tensor& /*qx*/, at::Tensor& /*qy*/);
2828
using qelu_fn = void(*)(
2929
const at::Tensor& /*qx*/,
30-
Scalar /*alpha*/,
30+
const Scalar& /*alpha*/,
3131
const Scalar& /*scale*/,
3232
const Scalar& /*input_scale*/,
3333
at::Tensor& /*qy*/);

0 commit comments

Comments
 (0)