Include some JIT things in C++ docs (#11712)

Summary:
Since we're making parts of the JIT public as part of loading script modules, they should be on the cppdocs website.

Orthogonal: We decided not to export things like `IValue` into the `torch` namespace, so `RegisterOperators` shouldn't be there either.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/11712

Differential Revision: D9837578

Pulled By: goldsborough

fbshipit-source-id: 4c06d2fa9dd4b4216951f27424c2ce795febab9c
This commit is contained in:
Peter Goldsborough
2018-09-17 23:15:57 -07:00
committed by Facebook Github Bot
parent bd43d64dd5
commit 63c811b3a6
5 changed files with 17 additions and 10 deletions

View File

@ -752,6 +752,10 @@ WARN_LOGFILE =
INPUT = ../../torch/csrc/api/include \
../../torch/csrc/api/src \
../../torch/csrc/jit/custom_operator.h \
../../torch/csrc/jit/import.h \
../../torch/csrc/jit/ivalue.h \
../../torch/csrc/jit/script/module.h \
../../aten/src/ATen/ATen.h \
../../aten/src/ATen/Backend.h \
../../aten/src/ATen/Device.h \

View File

@ -21,11 +21,12 @@ ignore_warning "warning: source ../../build/aten/src/ is not a readable file"
ignore_warning "warning: source ../../build/aten/src/ATen/Tensor.h is not a readable file"
ignore_warning "warning: source ../../build/aten/src/ATen/Functions.h is not a readable file"
ignore_warning "warning: documented symbol \`torch::nn::FunctionalImpl::FunctionalImpl' was not declared or defined"
ignore_warning "functional.h:81: warning: Found ';' while parsing initializer list!"
# Count the number of remaining warnings.
warnings=$(grep 'warning:' doxygen-log.txt | wc -l)
warnings="$(grep 'warning:' doxygen-log.txt | wc -l)"
if [[ $warnings != 0 ]]; then
if [[ "$warnings" -ne "0" ]]; then
echo "Filtered output"
cat doxygen-log.txt
rm -f doxygen-log.txt original-doxygen-log.txt

View File

@ -16,7 +16,7 @@ std::vector<at::Tensor> custom_op(
}
static auto registry =
torch::RegisterOperators()
torch::jit::RegisterOperators()
// We parse the schema for the user.
.op("custom::op", &custom_op)
// User provided schema. Among other things, allows defaulting values,

View File

@ -3,7 +3,8 @@
#include "torch/csrc/jit/ir.h"
#include "torch/csrc/jit/script/module.h"
namespace torch { namespace jit {
namespace torch {
namespace jit {
using ModuleLookup = std::function<std::shared_ptr<script::Module>(
const std::vector<std::string>&)>;
@ -12,6 +13,12 @@ TORCH_API void import_ir_module(
ModuleLookup module_lookup,
const std::string& filename);
/// Loads a serialized `script::Module` from the given `filename`.
///
/// The file stored at the location given in `filename` must contain a
/// serialized `script::Module`, exported either via `ScriptModule.save()` in
/// Python or `torch::jit::ExportModule` in C++.
TORCH_API std::shared_ptr<script::Module> load(const std::string& filename);
}}
} // namespace jit
} // namespace torch

View File

@ -6,8 +6,3 @@
#include <torch/csrc/WindowsTorchApiMacro.h>
#include <ATen/ATen.h>
namespace torch {
using jit::createOperator;
using jit::RegisterOperators;
} // namespace torch