Shortcuts

Program Listing for File upsampling.h

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

#pragma once

#include <c10/util/variant.h>
#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(c10::optional<std::vector<int64_t>>, size) = c10::nullopt;

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

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

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

namespace functional {

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

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

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

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

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

  TORCH_ARG(c10::optional<bool>, recompute_scale_factor) = c10::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