| 1 |
'use strict'; |
| 2 |
|
| 3 |
module.exports = { |
| 4 |
bufferization_dialect : $ => choice( |
| 5 |
seq('bufferization.alloc_tensor', field('in', $._value_use_list_parens), |
| 6 |
field('copy', optional(seq(token('copy'), '(', $.value_use, ')'))), |
| 7 |
field('size_hint', |
| 8 |
optional(seq(token('size_hint'), '=', $.value_use))), |
| 9 |
field('attributes', optional($.attribute)), |
| 10 |
field('return', $._type_annotation)), |
| 11 |
|
| 12 |
// operation ::= `bufferization.to_buffer` $tensor |
| 13 |
// attr-dict `:` type($memref) |
| 14 |
seq('bufferization.to_buffer', field('tensor', $.value_use), |
| 15 |
field('attributes', optional($.attribute)), |
| 16 |
field('return', $._type_annotation)), |
| 17 |
|
| 18 |
// operation ::= `bufferization.to_tensor` $memref |
| 19 |
// (`restrict` $restrict^)? |
| 20 |
// (`writable` $writable^)? attr-dict |
| 21 |
// `:` type($memref) |
| 22 |
seq('bufferization.to_tensor', field('memref', $.value_use), |
| 23 |
field('restrict', optional($.restrict_attr)), |
| 24 |
field('writable', optional($.writable_attr)), |
| 25 |
field('attributes', optional($.attribute)), |
| 26 |
field('return', $._type_annotation))) |
| 27 |
} |