#pragma once

// @generated by aten/src/ATen/gen.py

#include <ATen/Context.h>
#include <c10/core/ScalarType.h>
#include <c10/core/TensorOptions.h>

namespace c10 {
class Scalar;
}
namespace at {
struct Generator;
class Tensor;
struct Type;
} // namespace at

namespace at {
namespace native {
namespace legacy {
namespace cpu {

Tensor & _th_set_(Tensor & self, Storage source, int64_t storage_offset, IntArrayRef size, IntArrayRef stride);
Tensor & _th_set_(Tensor & self, const Tensor & source);
Tensor & _th_masked_fill_(Tensor & self, const Tensor & mask, Scalar value);
Tensor & s__th_masked_fill_(Tensor & self, const Tensor & mask, Scalar value);
Tensor & _th_masked_fill_bool_(Tensor & self, const Tensor & mask, Scalar value);
Tensor & s__th_masked_fill_bool_(Tensor & self, const Tensor & mask, Scalar value);
Tensor & _th_masked_scatter_(Tensor & self, const Tensor & mask, const Tensor & source);
Tensor & s__th_masked_scatter_(Tensor & self, const Tensor & mask, const Tensor & source);
Tensor & _th_masked_scatter_bool_(Tensor & self, const Tensor & mask, const Tensor & source);
Tensor & s__th_masked_scatter_bool_(Tensor & self, const Tensor & mask, const Tensor & source);
Tensor & _th_masked_select_out(Tensor & result, const Tensor & self, const Tensor & mask);
Tensor & s__th_masked_select_out(Tensor & result, const Tensor & self, const Tensor & mask);
Tensor _th_masked_select(const Tensor & self, const Tensor & mask);
Tensor s__th_masked_select(const Tensor & self, const Tensor & mask);
Tensor & _th_masked_select_bool_out(Tensor & result, const Tensor & self, const Tensor & mask);
Tensor & s__th_masked_select_bool_out(Tensor & result, const Tensor & self, const Tensor & mask);
Tensor _th_masked_select_bool(const Tensor & self, const Tensor & mask);
Tensor s__th_masked_select_bool(const Tensor & self, const Tensor & mask);
Tensor & _th_nonzero_out(Tensor & result, const Tensor & self);
Tensor _th_nonzero(const Tensor & self);
Tensor _th_clone(const Tensor & self);
Tensor & _th_index_copy_(Tensor & self, int64_t dim, const Tensor & index, const Tensor & source);
Tensor & _th_take_out(Tensor & result, const Tensor & self, const Tensor & index);
Tensor _th_take(const Tensor & self, const Tensor & index);
Tensor & _th_put_(Tensor & self, const Tensor & index, const Tensor & source, bool accumulate);
Tensor & _th_index_fill_(Tensor & self, int64_t dim, const Tensor & index, Scalar value);
Tensor & _th_scatter_(Tensor & self, int64_t dim, const Tensor & index, const Tensor & src);
Tensor & _th_scatter_(Tensor & self, int64_t dim, const Tensor & index, Scalar value);
Tensor & _th_scatter_add_(Tensor & self, int64_t dim, const Tensor & index, const Tensor & src);
Tensor & _th_gather_out(Tensor & result, const Tensor & self, int64_t dim, const Tensor & index);
Tensor _th_gather(const Tensor & self, int64_t dim, const Tensor & index);
bool _th_equal(const Tensor & self, const Tensor & other);
Tensor & _th_min_out(Tensor & result, const Tensor & self, const Tensor & other);
Tensor & s__th_min_out(Tensor & result, const Tensor & self, const Tensor & other);
Tensor _th_min(const Tensor & self, const Tensor & other);
Tensor s__th_min(const Tensor & self, const Tensor & other);
Tensor _th_min(const Tensor & self);
std::tuple<Tensor &,Tensor &> _th_min_out(Tensor & min, Tensor & min_indices, const Tensor & self, int64_t dim, bool keepdim);
std::tuple<Tensor,Tensor> _th_min(const Tensor & self, int64_t dim, bool keepdim);
Tensor & _th_max_out(Tensor & result, const Tensor & self, const Tensor & other);
Tensor & s__th_max_out(Tensor & result, const Tensor & self, const Tensor & other);
Tensor _th_max(const Tensor & self, const Tensor & other);
Tensor s__th_max(const Tensor & self, const Tensor & other);
Tensor _th_max(const Tensor & self);
std::tuple<Tensor &,Tensor &> _th_max_out(Tensor & max, Tensor & max_indices, const Tensor & self, int64_t dim, bool keepdim);
std::tuple<Tensor,Tensor> _th_max(const Tensor & self, int64_t dim, bool keepdim);
std::tuple<Tensor &,Tensor &> _th_mode_out(Tensor & values, Tensor & indices, const Tensor & self, int64_t dim, bool keepdim);
std::tuple<Tensor,Tensor> _th_mode(const Tensor & self, int64_t dim, bool keepdim);
std::tuple<Tensor &,Tensor &> _th_sort_out(Tensor & values, Tensor & indices, const Tensor & self, int64_t dim, bool descending);
std::tuple<Tensor,Tensor> _th_sort(const Tensor & self, int64_t dim, bool descending);
Tensor _th_var(const Tensor & self, bool unbiased);
Tensor _th_std(const Tensor & self, bool unbiased);
Tensor & _th_renorm_out(Tensor & result, const Tensor & self, Scalar p, int64_t dim, Scalar maxnorm);
Tensor _th_renorm(const Tensor & self, Scalar p, int64_t dim, Scalar maxnorm);
Tensor & _th_renorm_(Tensor & self, Scalar p, int64_t dim, Scalar maxnorm);
Tensor _th_dist(const Tensor & self, const Tensor & other, Scalar p);
Tensor s__th_dist(const Tensor & self, const Tensor & other, Scalar p);
Tensor & _th_histc_out(Tensor & result, const Tensor & self, int64_t bins, Scalar min, Scalar max);
Tensor _th_histc(const Tensor & self, int64_t bins, Scalar min, Scalar max);
Tensor & _th_cumsum_out(Tensor & result, const Tensor & self, int64_t dim);
Tensor _th_cumsum(const Tensor & self, int64_t dim);
Tensor & _th_cumprod_out(Tensor & result, const Tensor & self, int64_t dim);
Tensor _th_cumprod(const Tensor & self, int64_t dim);
Tensor _th_trace(const Tensor & self);
Tensor & _th_fmod_out(Tensor & result, const Tensor & self, Scalar other);
Tensor _th_fmod(const Tensor & self, Scalar other);
Tensor & _th_fmod_out(Tensor & result, const Tensor & self, const Tensor & other);
Tensor & s__th_fmod_out(Tensor & result, const Tensor & self, const Tensor & other);
Tensor _th_fmod(const Tensor & self, const Tensor & other);
Tensor s__th_fmod(const Tensor & self, const Tensor & other);
Tensor & _th_fmod_(Tensor & self, Scalar other);
Tensor & _th_fmod_(Tensor & self, const Tensor & other);
Tensor & s__th_fmod_(Tensor & self, const Tensor & other);
Tensor & _th_remainder_out(Tensor & result, const Tensor & self, Scalar other);
Tensor _th_remainder(const Tensor & self, Scalar other);
Tensor & _th_remainder_out(Tensor & result, const Tensor & self, const Tensor & other);
Tensor & s__th_remainder_out(Tensor & result, const Tensor & self, const Tensor & other);
Tensor _th_remainder(const Tensor & self, const Tensor & other);
Tensor s__th_remainder(const Tensor & self, const Tensor & other);
Tensor & _th_remainder_(Tensor & self, Scalar other);
Tensor & _th_remainder_(Tensor & self, const Tensor & other);
Tensor & s__th_remainder_(Tensor & self, const Tensor & other);
Tensor _th_dot(const Tensor & self, const Tensor & tensor);
Tensor & _th_diag_out(Tensor & result, const Tensor & self, int64_t diagonal);
Tensor _th_diag(const Tensor & self, int64_t diagonal);
Tensor & _th_addmm_out(Tensor & result, const Tensor & self, const Tensor & mat1, const Tensor & mat2, Scalar beta, Scalar alpha);
Tensor & s__th_addmm_out(Tensor & result, const Tensor & self, const Tensor & mat1, const Tensor & mat2, Scalar beta, Scalar alpha);
Tensor _th_addmm(const Tensor & self, const Tensor & mat1, const Tensor & mat2, Scalar beta, Scalar alpha);
Tensor s__th_addmm(const Tensor & self, const Tensor & mat1, const Tensor & mat2, Scalar beta, Scalar alpha);
Tensor & _th_addmm_(Tensor & self, const Tensor & mat1, const Tensor & mat2, Scalar beta, Scalar alpha);
Tensor & _th_addmv_out(Tensor & result, const Tensor & self, const Tensor & mat, const Tensor & vec, Scalar beta, Scalar alpha);
Tensor & s__th_addmv_out(Tensor & result, const Tensor & self, const Tensor & mat, const Tensor & vec, Scalar beta, Scalar alpha);
Tensor _th_addmv(const Tensor & self, const Tensor & mat, const Tensor & vec, Scalar beta, Scalar alpha);
Tensor s__th_addmv(const Tensor & self, const Tensor & mat, const Tensor & vec, Scalar beta, Scalar alpha);
Tensor & _th_addmv_(Tensor & self, const Tensor & mat, const Tensor & vec, Scalar beta, Scalar alpha);
Tensor & _th_addr_out(Tensor & result, const Tensor & self, const Tensor & vec1, const Tensor & vec2, Scalar beta, Scalar alpha);
Tensor & s__th_addr_out(Tensor & result, const Tensor & self, const Tensor & vec1, const Tensor & vec2, Scalar beta, Scalar alpha);
Tensor _th_addr(const Tensor & self, const Tensor & vec1, const Tensor & vec2, Scalar beta, Scalar alpha);
Tensor s__th_addr(const Tensor & self, const Tensor & vec1, const Tensor & vec2, Scalar beta, Scalar alpha);
Tensor & _th_addr_(Tensor & self, const Tensor & vec1, const Tensor & vec2, Scalar beta, Scalar alpha);
Tensor & _th_ger_out(Tensor & result, const Tensor & self, const Tensor & vec2);
Tensor _th_ger(const Tensor & self, const Tensor & vec2);
Tensor & _th_mv_out(Tensor & result, const Tensor & self, const Tensor & vec);
Tensor _th_mv(const Tensor & self, const Tensor & vec);
Tensor & _th_mm_out(Tensor & result, const Tensor & self, const Tensor & mat2);
Tensor _th_mm(const Tensor & self, const Tensor & mat2);
Tensor & _th_addbmm_out(Tensor & result, const Tensor & self, const Tensor & batch1, const Tensor & batch2, Scalar beta, Scalar alpha);
Tensor & s__th_addbmm_out(Tensor & result, const Tensor & self, const Tensor & batch1, const Tensor & batch2, Scalar beta, Scalar alpha);
Tensor _th_addbmm(const Tensor & self, const Tensor & batch1, const Tensor & batch2, Scalar beta, Scalar alpha);
Tensor s__th_addbmm(const Tensor & self, const Tensor & batch1, const Tensor & batch2, Scalar beta, Scalar alpha);
Tensor & _th_addbmm_(Tensor & self, const Tensor & batch1, const Tensor & batch2, Scalar beta, Scalar alpha);
std::tuple<Tensor &,Tensor &> _th_gels_out(Tensor & res1, Tensor & res2, const Tensor & self, const Tensor & A);
std::tuple<Tensor,Tensor> _th_gels(const Tensor & self, const Tensor & A);
std::tuple<Tensor &,Tensor &> _th_eig_out(Tensor & res1, Tensor & res2, const Tensor & self, bool eigenvectors);
std::tuple<Tensor,Tensor> _th_eig(const Tensor & self, bool eigenvectors);
Tensor & _th_potri_out(Tensor & output, const Tensor & self, bool upper);
Tensor _th_potri(const Tensor & self, bool upper);
std::tuple<Tensor &,Tensor &> _th_geqrf_out(Tensor & res1, Tensor & res2, const Tensor & self);
std::tuple<Tensor,Tensor> _th_geqrf(const Tensor & self);
Tensor & _th_orgqr_out(Tensor & result, const Tensor & self, const Tensor & input2);
Tensor _th_orgqr(const Tensor & self, const Tensor & input2);
Tensor & _th_ormqr_out(Tensor & result, const Tensor & self, const Tensor & input2, const Tensor & input3, bool left, bool transpose);
Tensor _th_ormqr(const Tensor & self, const Tensor & input2, const Tensor & input3, bool left, bool transpose);
Tensor & _th_random_(Tensor & self, int64_t from, int64_t to, Generator * generator);
Tensor & _th_random_(Tensor & self, int64_t to, Generator * generator);
Tensor & _th_random_(Tensor & self, Generator * generator);
std::tuple<Tensor &,Tensor &> _th_multinomial_alias_setup_out(Tensor & J, Tensor & q, const Tensor & probs);
std::tuple<Tensor,Tensor> _th_multinomial_alias_setup(const Tensor & probs);
Tensor & _th_multinomial_alias_draw_out(Tensor & result, const Tensor & q, const Tensor & J, int64_t num_samples, Generator * generator);
Tensor _th_multinomial_alias_draw(const Tensor & q, const Tensor & J, int64_t num_samples, Generator * generator);
Tensor & _th_uniform_(Tensor & self, double from, double to, Generator * generator);
Tensor & _th_normal_out(Tensor & output, const Tensor & mean, double std, Generator * generator);
Tensor _th_normal(const Tensor & mean, double std, Generator * generator);
Tensor & _th_normal_out(Tensor & output, double mean, const Tensor & std, Generator * generator);
Tensor _th_normal(double mean, const Tensor & std, Generator * generator);
Tensor & _th_normal_out(Tensor & output, const Tensor & mean, const Tensor & std, Generator * generator);
Tensor _th_normal(const Tensor & mean, const Tensor & std, Generator * generator);
Tensor & _th_normal_(Tensor & self, double mean, double std, Generator * generator);
Tensor & _th_log_normal_(Tensor & self, double mean, double std, Generator * generator);
Tensor & _th_exponential_(Tensor & self, double lambd, Generator * generator);
Tensor & _th_cat_out(Tensor & self, TensorList tensors, int64_t dim);
Tensor _th_cat(TensorList tensors, int64_t dim);
Tensor & _thnn_binary_cross_entropy_forward_out(Tensor & output, const Tensor & self, const Tensor & target, const Tensor & weight, int64_t reduction);
Tensor _thnn_binary_cross_entropy_forward(const Tensor & self, const Tensor & target, const Tensor & weight, int64_t reduction);
Tensor & _thnn_binary_cross_entropy_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, const Tensor & target, const Tensor & weight, int64_t reduction);
Tensor _thnn_binary_cross_entropy_backward(const Tensor & grad_output, const Tensor & self, const Tensor & target, const Tensor & weight, int64_t reduction);
Tensor & _thnn_glu_forward_out(Tensor & output, const Tensor & self, int64_t dim);
Tensor _thnn_glu_forward(const Tensor & self, int64_t dim);
Tensor & _thnn_glu_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, int64_t dim);
Tensor _thnn_glu_backward(const Tensor & grad_output, const Tensor & self, int64_t dim);

} // namespace th
} // namespace legacy
} // namespace native
} // namespace at
