Shortcuts

Program Listing for File upsampling.h

Return to documentation for file (torch/csrc/api/include/torch/nn/options/upsampling.h)

#pragma once

#include <torch/arg.h>
#include <torch/csrc/Export.h>
#include <torch/enum.h>
#include <torch/expanding_array.h>
#include <torch/types.h>

#include <vector>

namespace torch {
namespace nn {

struct TORCH_API UpsampleOptions {
  TORCH_ARG(std::optional<std::vector<int64_t>>, size) = std::nullopt;

  TORCH_ARG(std::optional<std::vector<double>>, scale_factor) = std::nullopt;

  typedef std::variant<
      enumtype::kNearest,
      enumtype::kLinear,
      enumtype::kBilinear,
      enumtype::kBicubic,
      enumtype::kTrilinear>
      mode_t;
  TORCH_ARG(mode_t, mode) = torch::kNearest;

  TORCH_ARG(std::optional<bool>, align_corners) = std::nullopt;
};

namespace functional {

struct TORCH_API InterpolateFuncOptions {
  typedef std::variant<
      enumtype::kNearest,
      enumtype::kLinear,
      enumtype::kBilinear,
      enumtype::kBicubic,
      enumtype::kTrilinear,
      enumtype::kArea,
      enumtype::kNearestExact>
      mode_t;

  TORCH_ARG(std::optional<std::vector<int64_t>>, size) = std::nullopt;

  TORCH_ARG(std::optional<std::vector<double>>, scale_factor) = std::nullopt;

  TORCH_ARG(mode_t, mode) = torch::kNearest;

  TORCH_ARG(std::optional<bool>, align_corners) = std::nullopt;

  TORCH_ARG(std::optional<bool>, recompute_scale_factor) = std::nullopt;

  TORCH_ARG(bool, antialias) = false;
};

} // namespace functional

} // namespace nn
} // namespace torch

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources