Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aten/src/ATen/native/TensorAdvancedIndexing.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ using scatter_add_fn = void(*)(Tensor& self, int64_t dim, const Tensor& index, c
using scatter_reduce_fn = void(*)(Tensor& self, const int64_t dim, const Tensor& index,
const Tensor& src, const SCATTER_GATHER_OP& reduce);
using scatter_scalar_reduce_fn = void(*)(Tensor& self, const int64_t dim, const Tensor& index,
Scalar& value, const SCATTER_GATHER_OP& reduce);
const Scalar& value, const SCATTER_GATHER_OP& reduce);

DECLARE_DISPATCH(index_fn, index_stub);
DECLARE_DISPATCH(index_fill_fn, index_fill_stub);
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/native/cpu/FillKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void fill_non_native_type(TensorIterator& iter, const Scalar& value_scalar) {
}

template <>
void fill_non_native_type<c10::complex<at::Half>>(TensorIterator& iter, Scalar value_scalar) {
void fill_non_native_type<c10::complex<at::Half>>(TensorIterator& iter, const Scalar& value_scalar) {
static_assert(sizeof(c10::complex<at::Half>) == sizeof(int32_t), "Size of ComplexHalf should be 32-bits");
auto value = c10::complex<at::Half>(value_scalar.to<c10::complex<float>>());
auto val = *reinterpret_cast<int32_t*>(std::addressof(value));
Expand Down
4 changes: 2 additions & 2 deletions aten/src/ATen/native/cpu/ScatterGatherKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ template <bool is_scatter_like = true>
struct cpu_scatter_gather_base_kernel {
template <typename func_t>
void operator()(Tensor& self, int64_t dim,
const Tensor& index, Scalar& value,
const Tensor& index, const Scalar& value,
const std::string& method_name, func_t& kernel_func) {
// no-op if index is empty
if (index.numel() == 0) {
Expand Down Expand Up @@ -338,7 +338,7 @@ void scatter_reduce_cpu_kernel(Tensor& self, const int64_t dim, const Tensor& in
}

void scatter_scalar_reduce_cpu_kernel(Tensor& self, const int64_t dim, const Tensor& index,
Scalar& value, const SCATTER_GATHER_OP& reduce) {
const Scalar& value, const SCATTER_GATHER_OP& reduce) {
switch (reduce) {
case SCATTER_GATHER_OP::REDUCE_ADD :
cpu_scatter_gather_base_kernel<>()(self, dim, index, value,
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/native/cuda/ScatterGatherKernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ void scatter_reduce_cuda_kernel(Tensor& self, const int64_t dim, const Tensor& i
}

void scatter_scalar_reduce_cuda_kernel(Tensor& self, const int64_t dim, const Tensor& index,
Scalar& value, const SCATTER_GATHER_OP& reduce) {
const Scalar& value, const SCATTER_GATHER_OP& reduce) {
switch (reduce) {
case SCATTER_GATHER_OP::REDUCE_ADD :
cuda_scatter_fill_base_kernel<false>()(self, dim, index, value,
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/native/quantized/cpu/quantized_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using qthreshold_fn = void (*)(
using qtanh_fn = void (*)(const at::Tensor& /*qx*/, at::Tensor& /*qy*/);
using qelu_fn = void(*)(
const at::Tensor& /*qx*/,
Scalar /*alpha*/,
const Scalar& /*alpha*/,
const Scalar& /*scale*/,
const Scalar& /*input_scale*/,
at::Tensor& /*qy*/);
Expand Down