/usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/jit/frontend
Edit: /usr/local/lib64/python3.6/site-packages/torch/include/torch/csrc/jit/frontend/schema_matching.h (1948B)
#pragma once
#include
#include
#include
#include
namespace torch {
namespace jit {
// Try to match a list of inputs and keyword 'attributes' to this
// schema. Return the flat list of positional inputs to the call or
// `c10::nullopt` on failure (`failure_messages` contains a good error
// report in this case)
struct MatchedSchema {
std::vector inputs;
std::vector return_types;
c10::OptNameList return_field_names;
};
TORCH_API MatchedSchema matchSchema(
const ::c10::FunctionSchema& schema,
const SourceRange& loc,
Graph& graph,
at::ArrayRef args,
at::ArrayRef kwargs,
const c10::optional& self = c10::nullopt);
TORCH_API std::pair matchSchemas(
const std::vector& schemas,
const SourceRange& loc,
Graph& graph,
at::ArrayRef args,
at::ArrayRef kwargs,
const c10::optional& self = c10::nullopt,
bool render_errors = false);
TORCH_API bool convertibleToList(
const TypePtr& type,
const TypePtr& list_type_);
TORCH_API Value* emitBuiltinCall(
const SourceRange& loc,
Graph& graph,
Symbol name,
at::ArrayRef args,
at::ArrayRef kwargs,
const c10::optional& self = c10::nullopt);
TORCH_API c10::optional findInputWithName(
const std::string& name,
at::ArrayRef kwargs);
// applies implicit conversion from value trying to turn it into type
// concrete_type it succeeds if the return_value->isSubtypeOf(concrete_type)
TORCH_API Value* tryConvertToType(
const SourceRange& loc,
Graph& graph,
const TypePtr& concrete_type,
Value* value,
bool allow_conversions);
} // namespace jit
} // namespace torch