4 bufferization_dialect : $ => choice(
5 seq('bufferization.alloc_tensor',
6 field('in', $._value_use_list_parens),
7 field('copy', optional(seq(token('copy'), '(',
10 optional(seq(token('size_hint'), '=',
12 field('attributes', optional($.attribute)),
13 field('return', $._type_annotation)),
15 // operation ::= `bufferization.to_memref` $tensor
16 // attr-dict `:` type($memref)
17 seq('bufferization.to_memref',
18 field('tensor', $.value_use),
19 field('attributes', optional($.attribute)),
20 field('return', $._type_annotation)),
22 // operation ::= `bufferization.to_tensor` $memref
23 // (`restrict` $restrict^)?
24 // (`writable` $writable^)? attr-dict
26 seq('bufferization.to_tensor',
27 field('memref', $.value_use),
28 field('restrict', optional($.restrict_attr)),
29 field('writable', optional($.writable_attr)),
30 field('attributes', optional($.attribute)),
31 field('return', $._type_annotation)))