sourcelibs/Accel/demos/windows.xtl
1⍝!/usr/bin/env xetal
2⍝ Windows: a rotation (o_-) of a vector by one amount and by three (one
3⍝ copy each); a convolution's 3 by 3 windows built as array operations
4⍝ (two rotations, four drops, a reshape), as X_eTaL-ML's Conv builds
5⍝ them; then a small convolution, two filters over a batch of two
6⍝ pictures as one matrix product. On a GPU each rotation and drop is
7⍝ a gather of its own; the reshape and the product follow. Run with
8⍝ "just demo-lib Accel windows".
9ᵃᶜ⁼u̲se< "Accel"
10v ← 1 2 3 4 5
111 o̲- v
12-1 0 1 o̲- v
13x ← 2 3 4 r̲eshape f̲loat r̲ange 24
14ᵃᶜw̲indows x
15k ← 2 9 r̲eshape 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0
16k ᵃᶜc̲onv x