// generated by rake generate:functions // do not edit by hand #include #include #include "templates.hpp" void add_nn_functions(Module m) { m .define_singleton_method( "_adaptive_avg_pool2d", *[](const Tensor &self, IntArrayRef output_size) { return torch::adaptive_avg_pool2d(self, output_size); }) .define_singleton_method( "_adaptive_avg_pool2d_out", *[](const Tensor &self, IntArrayRef output_size, Tensor &out) { return torch::adaptive_avg_pool2d_out(out, self, output_size); }) .define_singleton_method( "_adaptive_avg_pool3d", *[](const Tensor &self, IntArrayRef output_size) { return torch::adaptive_avg_pool3d(self, output_size); }) .define_singleton_method( "_adaptive_avg_pool3d_out", *[](const Tensor &self, IntArrayRef output_size, Tensor &out) { return torch::adaptive_avg_pool3d_out(out, self, output_size); }) .define_singleton_method( "_adaptive_max_pool2d", *[](const Tensor &self, IntArrayRef output_size) { return torch::adaptive_max_pool2d(self, output_size); }) .define_singleton_method( "_adaptive_max_pool2d_out", *[](const Tensor &self, IntArrayRef output_size, Tensor &out, Tensor &indices) { return torch::adaptive_max_pool2d_out(out, indices, self, output_size); }) .define_singleton_method( "_adaptive_max_pool3d", *[](const Tensor &self, IntArrayRef output_size) { return torch::adaptive_max_pool3d(self, output_size); }) .define_singleton_method( "_adaptive_max_pool3d_out", *[](const Tensor &self, IntArrayRef output_size, Tensor &out, Tensor &indices) { return torch::adaptive_max_pool3d_out(out, indices, self, output_size); }) .define_singleton_method( "_binary_cross_entropy", *[](const Tensor &self, const Tensor &target, OptionalTensor weight, MyReduction reduction) { return torch::binary_cross_entropy(self, target, weight, reduction); }) .define_singleton_method( "_binary_cross_entropy_out", *[](const Tensor &self, const Tensor &target, OptionalTensor weight, MyReduction reduction, Tensor &out) { return torch::binary_cross_entropy_out(out, self, target, weight, reduction); }) .define_singleton_method( "_col2im", *[](const Tensor &self, IntArrayRef output_size, IntArrayRef kernel_size, IntArrayRef dilation, IntArrayRef padding, IntArrayRef stride) { return torch::col2im(self, output_size, kernel_size, dilation, padding, stride); }) .define_singleton_method( "_col2im_out", *[](const Tensor &self, IntArrayRef output_size, IntArrayRef kernel_size, IntArrayRef dilation, IntArrayRef padding, IntArrayRef stride, Tensor &out) { return torch::col2im_out(out, self, output_size, kernel_size, dilation, padding, stride); }) .define_singleton_method( "_elu", *[](const Tensor &self, Scalar alpha, Scalar scale, Scalar input_scale) { return torch::elu(self, alpha, scale, input_scale); }) .define_singleton_method( "_elu_", *[](Tensor &self, Scalar alpha, Scalar scale, Scalar input_scale) { return torch::elu_(self, alpha, scale, input_scale); }) .define_singleton_method( "_elu_out", *[](const Tensor &self, Scalar alpha, Scalar scale, Scalar input_scale, Tensor &out) { return torch::elu_out(out, self, alpha, scale, input_scale); }) .define_singleton_method( "_fractional_max_pool2d", *[](const Tensor &self, IntArrayRef kernel_size, IntArrayRef output_size, const Tensor &random_samples) { return torch::fractional_max_pool2d(self, kernel_size, output_size, random_samples); }) .define_singleton_method( "_fractional_max_pool2d_output", *[](const Tensor &self, IntArrayRef kernel_size, IntArrayRef output_size, const Tensor &random_samples, Tensor &output, Tensor &indices) { return torch::fractional_max_pool2d_out(output, indices, self, kernel_size, output_size, random_samples); }) .define_singleton_method( "_fractional_max_pool3d", *[](const Tensor &self, IntArrayRef kernel_size, IntArrayRef output_size, const Tensor &random_samples) { return torch::fractional_max_pool3d(self, kernel_size, output_size, random_samples); }) .define_singleton_method( "_fractional_max_pool3d_output", *[](const Tensor &self, IntArrayRef kernel_size, IntArrayRef output_size, const Tensor &random_samples, Tensor &output, Tensor &indices) { return torch::fractional_max_pool3d_out(output, indices, self, kernel_size, output_size, random_samples); }) .define_singleton_method( "_gelu", *[](const Tensor &self) { return torch::gelu(self); }) .define_singleton_method( "_glu", *[](const Tensor &self, int64_t dim) { return torch::glu(self, dim); }) .define_singleton_method( "_glu_out", *[](const Tensor &self, int64_t dim, Tensor &out) { return torch::glu_out(out, self, dim); }) .define_singleton_method( "_hardtanh", *[](const Tensor &self, Scalar min_val, Scalar max_val) { return torch::hardtanh(self, min_val, max_val); }) .define_singleton_method( "_hardtanh_", *[](Tensor &self, Scalar min_val, Scalar max_val) { return torch::hardtanh_(self, min_val, max_val); }) .define_singleton_method( "_hardtanh_out", *[](const Tensor &self, Scalar min_val, Scalar max_val, Tensor &out) { return torch::hardtanh_out(out, self, min_val, max_val); }) .define_singleton_method( "_im2col", *[](const Tensor &self, IntArrayRef kernel_size, IntArrayRef dilation, IntArrayRef padding, IntArrayRef stride) { return torch::im2col(self, kernel_size, dilation, padding, stride); }) .define_singleton_method( "_im2col_out", *[](const Tensor &self, IntArrayRef kernel_size, IntArrayRef dilation, IntArrayRef padding, IntArrayRef stride, Tensor &out) { return torch::im2col_out(out, self, kernel_size, dilation, padding, stride); }) .define_singleton_method( "_l1_loss", *[](const Tensor &self, const Tensor &target, MyReduction reduction) { return torch::l1_loss(self, target, reduction); }) .define_singleton_method( "_l1_loss_out", *[](const Tensor &self, const Tensor &target, MyReduction reduction, Tensor &out) { return torch::l1_loss_out(out, self, target, reduction); }) .define_singleton_method( "_leaky_relu", *[](const Tensor &self, Scalar negative_slope) { return torch::leaky_relu(self, negative_slope); }) .define_singleton_method( "_leaky_relu_", *[](Tensor &self, Scalar negative_slope) { return torch::leaky_relu_(self, negative_slope); }) .define_singleton_method( "_leaky_relu_out", *[](const Tensor &self, Scalar negative_slope, Tensor &out) { return torch::leaky_relu_out(out, self, negative_slope); }) .define_singleton_method( "_linear", *[](const Tensor &input, const Tensor &weight, OptionalTensor bias) { return torch::linear(input, weight, bias); }) .define_singleton_method( "_log_sigmoid", *[](const Tensor &self) { return torch::log_sigmoid(self); }) .define_singleton_method( "_log_sigmoid_forward", *[](const Tensor &self) { return torch::log_sigmoid_forward(self); }) .define_singleton_method( "_log_sigmoid_forward_output", *[](const Tensor &self, Tensor &output, Tensor &buffer) { return torch::log_sigmoid_forward_out(output, buffer, self); }) .define_singleton_method( "_log_sigmoid_out", *[](const Tensor &self, Tensor &out) { return torch::log_sigmoid_out(out, self); }) .define_singleton_method( "_max_pool2d_with_indices", *[](const Tensor &self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool ceil_mode) { return torch::max_pool2d_with_indices(self, kernel_size, stride, padding, dilation, ceil_mode); }) .define_singleton_method( "_max_pool2d_with_indices_out", *[](const Tensor &self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool ceil_mode, Tensor &out, Tensor &indices) { return torch::max_pool2d_with_indices_out(out, indices, self, kernel_size, stride, padding, dilation, ceil_mode); }) .define_singleton_method( "_max_pool3d_with_indices", *[](const Tensor &self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool ceil_mode) { return torch::max_pool3d_with_indices(self, kernel_size, stride, padding, dilation, ceil_mode); }) .define_singleton_method( "_max_pool3d_with_indices_out", *[](const Tensor &self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool ceil_mode, Tensor &out, Tensor &indices) { return torch::max_pool3d_with_indices_out(out, indices, self, kernel_size, stride, padding, dilation, ceil_mode); }) .define_singleton_method( "_max_unpool2d", *[](const Tensor &self, const Tensor &indices, IntArrayRef output_size) { return torch::max_unpool2d(self, indices, output_size); }) .define_singleton_method( "_max_unpool2d_out", *[](const Tensor &self, const Tensor &indices, IntArrayRef output_size, Tensor &out) { return torch::max_unpool2d_out(out, self, indices, output_size); }) .define_singleton_method( "_max_unpool3d", *[](const Tensor &self, const Tensor &indices, IntArrayRef output_size, IntArrayRef stride, IntArrayRef padding) { return torch::max_unpool3d(self, indices, output_size, stride, padding); }) .define_singleton_method( "_max_unpool3d_out", *[](const Tensor &self, const Tensor &indices, IntArrayRef output_size, IntArrayRef stride, IntArrayRef padding, Tensor &out) { return torch::max_unpool3d_out(out, self, indices, output_size, stride, padding); }) .define_singleton_method( "_mkldnn_linear", *[](const Tensor &input, const Tensor &weight, OptionalTensor bias) { return torch::mkldnn_linear(input, weight, bias); }) .define_singleton_method( "_mkldnn_reorder_conv2d_weight", *[](const Tensor &self, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups) { return torch::mkldnn_reorder_conv2d_weight(self, padding, stride, dilation, groups); }) .define_singleton_method( "_mse_loss", *[](const Tensor &self, const Tensor &target, MyReduction reduction) { return torch::mse_loss(self, target, reduction); }) .define_singleton_method( "_mse_loss_out", *[](const Tensor &self, const Tensor &target, MyReduction reduction, Tensor &out) { return torch::mse_loss_out(out, self, target, reduction); }) .define_singleton_method( "_multi_margin_loss", *[](const Tensor &self, const Tensor &target, Scalar p, Scalar margin, OptionalTensor weight, MyReduction reduction) { return torch::multi_margin_loss(self, target, p, margin, weight, reduction); }) .define_singleton_method( "_multi_margin_loss_out", *[](const Tensor &self, const Tensor &target, Scalar p, Scalar margin, OptionalTensor weight, MyReduction reduction, Tensor &out) { return torch::multi_margin_loss_out(out, self, target, p, margin, weight, reduction); }) .define_singleton_method( "_multilabel_margin_loss", *[](const Tensor &self, const Tensor &target, MyReduction reduction) { return torch::multilabel_margin_loss(self, target, reduction); }) .define_singleton_method( "_multilabel_margin_loss_forward", *[](const Tensor &self, const Tensor &target, MyReduction reduction) { return torch::multilabel_margin_loss_forward(self, target, reduction); }) .define_singleton_method( "_multilabel_margin_loss_forward_output", *[](const Tensor &self, const Tensor &target, MyReduction reduction, Tensor &output, Tensor &is_target) { return torch::multilabel_margin_loss_forward_out(output, is_target, self, target, reduction); }) .define_singleton_method( "_multilabel_margin_loss_out", *[](const Tensor &self, const Tensor &target, MyReduction reduction, Tensor &out) { return torch::multilabel_margin_loss_out(out, self, target, reduction); }) .define_singleton_method( "_nll_loss", *[](const Tensor &self, const Tensor &target, OptionalTensor weight, MyReduction reduction, int64_t ignore_index) { return torch::nll_loss(self, target, weight, reduction, ignore_index); }) .define_singleton_method( "_nll_loss2d", *[](const Tensor &self, const Tensor &target, OptionalTensor weight, MyReduction reduction, int64_t ignore_index) { return torch::nll_loss2d(self, target, weight, reduction, ignore_index); }) .define_singleton_method( "_nll_loss2d_forward", *[](const Tensor &self, const Tensor &target, OptionalTensor weight, MyReduction reduction, int64_t ignore_index) { return torch::nll_loss2d_forward(self, target, weight, reduction, ignore_index); }) .define_singleton_method( "_nll_loss2d_forward_output", *[](const Tensor &self, const Tensor &target, OptionalTensor weight, MyReduction reduction, int64_t ignore_index, Tensor &output, Tensor &total_weight) { return torch::nll_loss2d_forward_out(output, total_weight, self, target, weight, reduction, ignore_index); }) .define_singleton_method( "_nll_loss2d_out", *[](const Tensor &self, const Tensor &target, OptionalTensor weight, MyReduction reduction, int64_t ignore_index, Tensor &out) { return torch::nll_loss2d_out(out, self, target, weight, reduction, ignore_index); }) .define_singleton_method( "_nll_loss_forward", *[](const Tensor &self, const Tensor &target, OptionalTensor weight, MyReduction reduction, int64_t ignore_index) { return torch::nll_loss_forward(self, target, weight, reduction, ignore_index); }) .define_singleton_method( "_nll_loss_forward_output", *[](const Tensor &self, const Tensor &target, OptionalTensor weight, MyReduction reduction, int64_t ignore_index, Tensor &output, Tensor &total_weight) { return torch::nll_loss_forward_out(output, total_weight, self, target, weight, reduction, ignore_index); }) .define_singleton_method( "_nll_loss_out", *[](const Tensor &self, const Tensor &target, OptionalTensor weight, MyReduction reduction, int64_t ignore_index, Tensor &out) { return torch::nll_loss_out(out, self, target, weight, reduction, ignore_index); }) .define_singleton_method( "_one_hot", *[](const Tensor &self, int64_t num_classes) { return torch::one_hot(self, num_classes); }) .define_singleton_method( "_reflection_pad1d", *[](const Tensor &self, IntArrayRef padding) { return torch::reflection_pad1d(self, padding); }) .define_singleton_method( "_reflection_pad1d_out", *[](const Tensor &self, IntArrayRef padding, Tensor &out) { return torch::reflection_pad1d_out(out, self, padding); }) .define_singleton_method( "_reflection_pad2d", *[](const Tensor &self, IntArrayRef padding) { return torch::reflection_pad2d(self, padding); }) .define_singleton_method( "_reflection_pad2d_out", *[](const Tensor &self, IntArrayRef padding, Tensor &out) { return torch::reflection_pad2d_out(out, self, padding); }) .define_singleton_method( "_replication_pad1d", *[](const Tensor &self, IntArrayRef padding) { return torch::replication_pad1d(self, padding); }) .define_singleton_method( "_replication_pad1d_out", *[](const Tensor &self, IntArrayRef padding, Tensor &out) { return torch::replication_pad1d_out(out, self, padding); }) .define_singleton_method( "_replication_pad2d", *[](const Tensor &self, IntArrayRef padding) { return torch::replication_pad2d(self, padding); }) .define_singleton_method( "_replication_pad2d_out", *[](const Tensor &self, IntArrayRef padding, Tensor &out) { return torch::replication_pad2d_out(out, self, padding); }) .define_singleton_method( "_replication_pad3d", *[](const Tensor &self, IntArrayRef padding) { return torch::replication_pad3d(self, padding); }) .define_singleton_method( "_replication_pad3d_out", *[](const Tensor &self, IntArrayRef padding, Tensor &out) { return torch::replication_pad3d_out(out, self, padding); }) .define_singleton_method( "_rrelu_with_noise", *[](const Tensor &self, const Tensor &noise, Scalar lower, Scalar upper, bool training) { return torch::rrelu_with_noise(self, noise, lower, upper, training); }) .define_singleton_method( "_rrelu_with_noise_", *[](Tensor &self, const Tensor &noise, Scalar lower, Scalar upper, bool training) { return torch::rrelu_with_noise_(self, noise, lower, upper, training); }) .define_singleton_method( "_rrelu_with_noise_out", *[](const Tensor &self, const Tensor &noise, Scalar lower, Scalar upper, bool training, Tensor &out) { return torch::rrelu_with_noise_out(out, self, noise, lower, upper, training); }) .define_singleton_method( "_slow_conv_dilated2d", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation) { return torch::slow_conv_dilated2d(self, weight, kernel_size, bias, stride, padding, dilation); }) .define_singleton_method( "_slow_conv_dilated3d", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation) { return torch::slow_conv_dilated3d(self, weight, kernel_size, bias, stride, padding, dilation); }) .define_singleton_method( "_slow_conv_transpose2d", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef dilation) { return torch::slow_conv_transpose2d(self, weight, kernel_size, bias, stride, padding, output_padding, dilation); }) .define_singleton_method( "_slow_conv_transpose2d_out", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef dilation, Tensor &out) { return torch::slow_conv_transpose2d_out(out, self, weight, kernel_size, bias, stride, padding, output_padding, dilation); }) .define_singleton_method( "_slow_conv_transpose3d", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef dilation) { return torch::slow_conv_transpose3d(self, weight, kernel_size, bias, stride, padding, output_padding, dilation); }) .define_singleton_method( "_slow_conv_transpose3d_out", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef dilation, Tensor &out) { return torch::slow_conv_transpose3d_out(out, self, weight, kernel_size, bias, stride, padding, output_padding, dilation); }) .define_singleton_method( "_smooth_l1_loss", *[](const Tensor &self, const Tensor &target, MyReduction reduction) { return torch::smooth_l1_loss(self, target, reduction); }) .define_singleton_method( "_smooth_l1_loss_out", *[](const Tensor &self, const Tensor &target, MyReduction reduction, Tensor &out) { return torch::smooth_l1_loss_out(out, self, target, reduction); }) .define_singleton_method( "_soft_margin_loss", *[](const Tensor &self, const Tensor &target, MyReduction reduction) { return torch::soft_margin_loss(self, target, reduction); }) .define_singleton_method( "_soft_margin_loss_out", *[](const Tensor &self, const Tensor &target, MyReduction reduction, Tensor &out) { return torch::soft_margin_loss_out(out, self, target, reduction); }) .define_singleton_method( "_softplus", *[](const Tensor &self, Scalar beta, Scalar threshold) { return torch::softplus(self, beta, threshold); }) .define_singleton_method( "_softplus_out", *[](const Tensor &self, Scalar beta, Scalar threshold, Tensor &out) { return torch::softplus_out(out, self, beta, threshold); }) .define_singleton_method( "_softshrink", *[](const Tensor &self, Scalar lambd) { return torch::softshrink(self, lambd); }) .define_singleton_method( "_softshrink_out", *[](const Tensor &self, Scalar lambd, Tensor &out) { return torch::softshrink_out(out, self, lambd); }) .define_singleton_method( "_thnn_conv2d", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding) { return torch::thnn_conv2d(self, weight, kernel_size, bias, stride, padding); }) .define_singleton_method( "_thnn_conv2d_forward", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding) { return torch::thnn_conv2d_forward(self, weight, kernel_size, bias, stride, padding); }) .define_singleton_method( "_thnn_conv2d_forward_output", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding, Tensor &output, Tensor &finput, Tensor &fgrad_input) { return torch::thnn_conv2d_forward_out(output, finput, fgrad_input, self, weight, kernel_size, bias, stride, padding); }) .define_singleton_method( "_thnn_conv2d_out", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding, Tensor &out) { return torch::thnn_conv2d_out(out, self, weight, kernel_size, bias, stride, padding); }) .define_singleton_method( "_thnn_conv3d", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding) { return torch::thnn_conv3d(self, weight, kernel_size, bias, stride, padding); }) .define_singleton_method( "_thnn_conv3d_forward", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding) { return torch::thnn_conv3d_forward(self, weight, kernel_size, bias, stride, padding); }) .define_singleton_method( "_thnn_conv3d_forward_output", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding, Tensor &output, Tensor &finput, Tensor &fgrad_input) { return torch::thnn_conv3d_forward_out(output, finput, fgrad_input, self, weight, kernel_size, bias, stride, padding); }) .define_singleton_method( "_thnn_conv3d_out", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding, Tensor &out) { return torch::thnn_conv3d_out(out, self, weight, kernel_size, bias, stride, padding); }) .define_singleton_method( "_thnn_conv_depthwise2d", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation) { return torch::thnn_conv_depthwise2d(self, weight, kernel_size, bias, stride, padding, dilation); }) .define_singleton_method( "_thnn_conv_depthwise2d_forward", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation) { return torch::thnn_conv_depthwise2d_forward(self, weight, kernel_size, bias, stride, padding, dilation); }) .define_singleton_method( "_thnn_conv_depthwise2d_forward_out", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, Tensor &out) { return torch::thnn_conv_depthwise2d_forward_out(out, self, weight, kernel_size, bias, stride, padding, dilation); }) .define_singleton_method( "_thnn_conv_depthwise2d_out", *[](const Tensor &self, const Tensor &weight, IntArrayRef kernel_size, OptionalTensor bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, Tensor &out) { return torch::thnn_conv_depthwise2d_out(out, self, weight, kernel_size, bias, stride, padding, dilation); }) .define_singleton_method( "_upsample_bicubic2d", *[](const Tensor &self, IntArrayRef output_size, bool align_corners) { return torch::upsample_bicubic2d(self, output_size, align_corners); }) .define_singleton_method( "_upsample_bicubic2d_out", *[](const Tensor &self, IntArrayRef output_size, bool align_corners, Tensor &out) { return torch::upsample_bicubic2d_out(out, self, output_size, align_corners); }) .define_singleton_method( "_upsample_bilinear2d", *[](const Tensor &self, IntArrayRef output_size, bool align_corners) { return torch::upsample_bilinear2d(self, output_size, align_corners); }) .define_singleton_method( "_upsample_bilinear2d_out", *[](const Tensor &self, IntArrayRef output_size, bool align_corners, Tensor &out) { return torch::upsample_bilinear2d_out(out, self, output_size, align_corners); }) .define_singleton_method( "_upsample_linear1d", *[](const Tensor &self, IntArrayRef output_size, bool align_corners) { return torch::upsample_linear1d(self, output_size, align_corners); }) .define_singleton_method( "_upsample_linear1d_out", *[](const Tensor &self, IntArrayRef output_size, bool align_corners, Tensor &out) { return torch::upsample_linear1d_out(out, self, output_size, align_corners); }) .define_singleton_method( "_upsample_nearest1d", *[](const Tensor &self, IntArrayRef output_size) { return torch::upsample_nearest1d(self, output_size); }) .define_singleton_method( "_upsample_nearest1d_out", *[](const Tensor &self, IntArrayRef output_size, Tensor &out) { return torch::upsample_nearest1d_out(out, self, output_size); }) .define_singleton_method( "_upsample_nearest2d", *[](const Tensor &self, IntArrayRef output_size) { return torch::upsample_nearest2d(self, output_size); }) .define_singleton_method( "_upsample_nearest2d_out", *[](const Tensor &self, IntArrayRef output_size, Tensor &out) { return torch::upsample_nearest2d_out(out, self, output_size); }) .define_singleton_method( "_upsample_nearest3d", *[](const Tensor &self, IntArrayRef output_size) { return torch::upsample_nearest3d(self, output_size); }) .define_singleton_method( "_upsample_nearest3d_out", *[](const Tensor &self, IntArrayRef output_size, Tensor &out) { return torch::upsample_nearest3d_out(out, self, output_size); }) .define_singleton_method( "_upsample_trilinear3d", *[](const Tensor &self, IntArrayRef output_size, bool align_corners) { return torch::upsample_trilinear3d(self, output_size, align_corners); }) .define_singleton_method( "_upsample_trilinear3d_out", *[](const Tensor &self, IntArrayRef output_size, bool align_corners, Tensor &out) { return torch::upsample_trilinear3d_out(out, self, output_size, align_corners); }); }