1[
2 {"type":"CommentPreproc","value":"#include "},
3 {"type":"LiteralString","value":"\"main\""},
4 {"type":"Text","value":"\n\n"},
5 {"type":"CommentPreproc","value":"#ifndef SHOULD_DEF"},
6 {"type":"Text","value":"\n"},
7 {"type":"CommentPreproc","value":"#define SHOULD_DEF"},
8 {"type":"Text","value":"\n"},
9 {"type":"Keyword","value":"def"},
10 {"type":"Text","value":" "},
11 {"type":"NameVariable","value":"ConstantOp"},
12 {"type":"Text","value":" "},
13 {"type":"Punctuation","value":":"},
14 {"type":"Text","value":" "},
15 {"type":"NameVariable","value":"Toy_Op"},
16 {"type":"Punctuation","value":"\u003c"},
17 {"type":"LiteralString","value":"\"constant\""},
18 {"type":"Punctuation","value":","},
19 {"type":"Text","value":" "},
20 {"type":"Punctuation","value":"["},
21 {"type":"NameVariable","value":"NoSideEffect"},
22 {"type":"Punctuation","value":"]\u003e"},
23 {"type":"Text","value":" "},
24 {"type":"Punctuation","value":"{"},
25 {"type":"Text","value":"\n "},
26 {"type":"Comment","value":"// Provide a summary and description for this operation. This can be used to\n"},
27 {"type":"Text","value":" "},
28 {"type":"Comment","value":"// auto-generate documenatation of the operations within our dialect.\n"},
29 {"type":"Text","value":" "},
30 {"type":"Keyword","value":"let"},
31 {"type":"Text","value":" "},
32 {"type":"NameVariable","value":"summary"},
33 {"type":"Text","value":" "},
34 {"type":"Punctuation","value":"="},
35 {"type":"Text","value":" "},
36 {"type":"LiteralString","value":"\"constant operation\""},
37 {"type":"Punctuation","value":";"},
38 {"type":"Text","value":"\n "},
39 {"type":"Keyword","value":"let"},
40 {"type":"Text","value":" "},
41 {"type":"NameVariable","value":"description"},
42 {"type":"Text","value":" "},
43 {"type":"Punctuation","value":"="},
44 {"type":"Text","value":" "},
45 {"type":"LiteralString","value":"[{\n Constant operation turns a literal into an SSA value. The data is attached\n to the operation as an attribute. For example:\n\n %0 = \"toy.constant\"()\n { value = dense\u003c[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]\u003e : tensor\u003c2x3xf64\u003e }\n : () -\u003e tensor\u003c2x3xf64\u003e\n }]"},
46 {"type":"Punctuation","value":";"},
47 {"type":"Text","value":"\n\n "},
48 {"type":"Comment","value":"// The constant operation takes an attribute as the only input.\n"},
49 {"type":"Text","value":" "},
50 {"type":"Comment","value":"// `F64ElementsAttr` corresponds to a 64-bit floating-point ElementsAttr.\n"},
51 {"type":"Text","value":" "},
52 {"type":"Keyword","value":"let"},
53 {"type":"Text","value":" "},
54 {"type":"NameVariable","value":"arguments"},
55 {"type":"Text","value":" "},
56 {"type":"Punctuation","value":"="},
57 {"type":"Text","value":" "},
58 {"type":"Punctuation","value":"("},
59 {"type":"NameVariable","value":"ins"},
60 {"type":"Text","value":" "},
61 {"type":"NameVariable","value":"F64ElementsAttr"},
62 {"type":"Punctuation","value":":"},
63 {"type":"NameVariable","value":"$value"},
64 {"type":"Punctuation","value":");"},
65 {"type":"Text","value":"\n\n "},
66 {"type":"Comment","value":"// The generic call operation returns a single value of TensorType.\n"},
67 {"type":"Text","value":" "},
68 {"type":"Comment","value":"// F64Tensor corresponds to a 64-bit floating-point TensorType.\n"},
69 {"type":"Text","value":" "},
70 {"type":"Keyword","value":"let"},
71 {"type":"Text","value":" "},
72 {"type":"NameVariable","value":"results"},
73 {"type":"Text","value":" "},
74 {"type":"Punctuation","value":"="},
75 {"type":"Text","value":" "},
76 {"type":"Punctuation","value":"("},
77 {"type":"NameVariable","value":"outs"},
78 {"type":"Text","value":" "},
79 {"type":"NameVariable","value":"F64Tensor"},
80 {"type":"Punctuation","value":"\u003c"},
81 {"type":"LiteralNumber","value":"10"},
82 {"type":"Punctuation","value":"\u003e);"},
83 {"type":"Text","value":"\n\n "},
84 {"type":"Comment","value":"// Add additional verification logic to the constant operation.\n"},
85 {"type":"Text","value":" "},
86 {"type":"Keyword","value":"let"},
87 {"type":"Text","value":" "},
88 {"type":"NameVariable","value":"verifier"},
89 {"type":"Text","value":" "},
90 {"type":"Punctuation","value":"="},
91 {"type":"Text","value":" "},
92 {"type":"LiteralString","value":"[{ return ::verify(*this); }]"},
93 {"type":"Punctuation","value":";"},
94 {"type":"Text","value":"\n"},
95 {"type":"Punctuation","value":"}"},
96 {"type":"Text","value":"\n"},
97 {"type":"CommentPreproc","value":"#endif"},
98 {"type":"Text","value":" "},
99 {"type":"Comment","value":"// SHOULD_DEF\n"}
100]
View as plain text