Caffe2 - C++ API
A deep learning, cross platform ML framework
Related Pages
Modules
Data Structures
Files
C++ API
Python API
GitHub
File List
Globals
torch
csrc
jit
script
schema_matching.h
1
#pragma once
2
#include <torch/csrc/WindowsTorchApiMacro.h>
3
#include <torch/csrc/jit/ir.h>
4
#include <torch/csrc/jit/named_value.h>
5
6
#include <ATen/core/function_schema.h>
7
8
namespace
torch
{
9
namespace
jit {
10
namespace
script {
11
12
// try to match a list if inputs and keyword 'attributes' to this schema,
13
// if it works return the flat list of positional inputs to the call
14
// if it returns nullopt, then failure_messages contains a good error report
15
// set convert_tensor_to_num to true if ImplicitTensorToNums should be inserted
16
// to match the schema
17
18
struct
MatchedSchema
{
19
std::vector<Value*> inputs;
20
std::vector<TypePtr> return_types;
21
c10::OptNameList
return_field_names;
22
};
23
24
TORCH_API
c10::optional<MatchedSchema>
tryMatchSchema(
25
const ::c10::FunctionSchema& schema,
26
const
SourceRange
& loc,
27
Graph
& graph,
28
c10::optional<NamedValue>
self
,
29
at::ArrayRef<NamedValue>
inputs,
30
at::ArrayRef<NamedValue>
attributes,
31
std::ostream& failure_messages,
32
bool
allow_conversions);
33
34
TORCH_API
Value
* emitBuiltinCall(
35
const
SourceRange
& loc,
36
Graph
& graph,
37
Symbol
name,
38
const
c10::optional<NamedValue>
&
self
,
39
at::ArrayRef<NamedValue>
inputs,
40
at::ArrayRef<NamedValue>
attributes,
41
// if true, emitBuiltinCall will throw an exception if this builtin does not
42
// exist, otherwise it will return nullptr if the builtin is not found.
43
bool
required);
44
45
TORCH_API
c10::optional<size_t>
findInputWithName(
46
const
std::string& name,
47
at::ArrayRef<NamedValue>
kwargs);
48
49
// applies implict conversion from value trying to turn it into type
50
// concrete_type it succeeds if the return_value->isSubclassOf(concrete_type)
51
TORCH_API
Value
* tryConvertToType(
52
const
SourceRange
& loc,
53
Graph
& graph,
54
const
TypePtr& concrete_type,
55
Value
* value,
56
bool
allow_conversions);
57
58
}
// namespace script
59
}
// namespace jit
60
}
// namespace torch
torch::jit::Graph
Definition:
ir.h:936
torch::jit::Value
Definition:
ir.h:144
c10::optional
Definition:
Optional.h:118
torch
Definition:
jit_type.h:17
c10::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition:
ArrayRef.h:41
c10::Symbol
Definition:
interned_strings.h:215
torch::jit::script::MatchedSchema
Definition:
schema_matching.h:18
torch::jit::SourceRange
Definition:
source_range.h:14
Generated on Thu Mar 21 2019 13:06:24 for Caffe2 - C++ API by
1.8.11