tensor_stream 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +10 -0
  3. data/README.md +38 -17
  4. data/benchmark/benchmark.rb +16 -20
  5. data/lib/tensor_stream/control_flow.rb +3 -3
  6. data/lib/tensor_stream/debugging/debugging.rb +4 -4
  7. data/lib/tensor_stream/device.rb +5 -2
  8. data/lib/tensor_stream/evaluator/base_evaluator.rb +138 -0
  9. data/lib/tensor_stream/evaluator/buffer.rb +7 -2
  10. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/_bool_operand.cl +3 -3
  11. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/_operand.cl +0 -0
  12. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/abs.cl +0 -0
  13. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/add.cl +1 -1
  14. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/argmax.cl +0 -0
  15. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/argmin.cl +0 -0
  16. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/cast.cl +0 -0
  17. data/lib/tensor_stream/evaluator/opencl/kernels/cond.cl.erb +6 -0
  18. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/cos.cl +0 -0
  19. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/div.cl.erb +1 -1
  20. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/exp.cl +0 -0
  21. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/gemm.cl +0 -0
  22. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/log.cl +0 -0
  23. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/log1p.cl +0 -0
  24. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/max.cl +3 -3
  25. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/mul.cl +1 -1
  26. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/negate.cl +0 -0
  27. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/pow.cl +3 -3
  28. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/reciprocal.cl +0 -0
  29. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/round.cl +0 -0
  30. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/sigmoid.cl +0 -0
  31. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/sigmoid_grad.cl +3 -3
  32. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/sign.cl +1 -1
  33. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/sin.cl +0 -0
  34. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/softmax.cl +0 -0
  35. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/softmax_grad.cl +0 -0
  36. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/sqrt.cl +0 -0
  37. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/square.cl +0 -0
  38. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/sub.cl +1 -1
  39. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/tan.cl +0 -0
  40. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/tanh.cl +0 -0
  41. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/tanh_grad.cl +0 -0
  42. data/lib/tensor_stream/evaluator/{kernels → opencl/kernels}/where.cl +1 -1
  43. data/lib/tensor_stream/evaluator/{opencl_buffer.rb → opencl/opencl_buffer.rb} +1 -1
  44. data/lib/tensor_stream/evaluator/opencl/opencl_device.rb +5 -0
  45. data/lib/tensor_stream/evaluator/{opencl_evaluator.rb → opencl/opencl_evaluator.rb} +404 -452
  46. data/lib/tensor_stream/evaluator/{opencl_template_helper.rb → opencl/opencl_template_helper.rb} +6 -6
  47. data/lib/tensor_stream/evaluator/operation_helpers/array_ops_helper.rb +21 -21
  48. data/lib/tensor_stream/evaluator/ruby_evaluator.rb +492 -398
  49. data/lib/tensor_stream/graph.rb +21 -1
  50. data/lib/tensor_stream/graph_serializers/graphml.rb +59 -59
  51. data/lib/tensor_stream/graph_serializers/pbtext.rb +1 -1
  52. data/lib/tensor_stream/helpers/op_helper.rb +6 -2
  53. data/lib/tensor_stream/math_gradients.rb +7 -7
  54. data/lib/tensor_stream/operation.rb +100 -100
  55. data/lib/tensor_stream/session.rb +81 -8
  56. data/lib/tensor_stream/tensor.rb +7 -5
  57. data/lib/tensor_stream/utils.rb +32 -19
  58. data/lib/tensor_stream/version.rb +1 -1
  59. data/tensor_stream.gemspec +0 -1
  60. data/test_samples/raw_neural_net_sample.rb +7 -7
  61. metadata +41 -53
  62. data/lib/tensor_stream/evaluator/kernels/cond.cl.erb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f81afeff05b9a0f1de35ce4ae9f92512616d3b31
4
- data.tar.gz: 456edc9cf0f35dc6923d698fcd0a8f461c0ce213
3
+ metadata.gz: bb0eeddbfc4edec804a8207a5c708272245229dd
4
+ data.tar.gz: 399ea9f9b5f92376168a814a8c48c90d9c9f8371
5
5
  SHA512:
6
- metadata.gz: eb33302d0498e76e8468396e410735e2af321d542639809c2f850645379ac349c3f8ca8cb80962ff495b69e72abb5445e85785f49b8786bab8918a15953992c4
7
- data.tar.gz: '08f471cb1322665a594b967299f87ac4ea7d8c90ce73ddbfcbb202f783d133c6ea36c15bd59fec194cea78cabef21e9cbb1b71283dbdc99f570e81da28133952'
6
+ metadata.gz: b2e4f871654bad8e35147643dd371de24689bb2971a20d352488e339d0a8b298757c4a8e335d4706a384b5aebf265b65281db721d2228901b194fb07092e8797
7
+ data.tar.gz: 48e9f34c17bb1f1673383d38c56429885cfb07f835374b7426a45e23695134ea05cc9faedd3a22d22da8a2c72da959d2063f8243ed52f8491aae4dfcc9507ccf
data/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.5.0] - 2018-06-25
8
+ ### Added
9
+ - [OpenCL] boolean types now use short by default
10
+ - [OpenCL] Supported multiple OpenCL devices in one model
11
+ - Added support for tf.device to alter device placement when using OpenCL
12
+ - Internal changes to allow placement of tensor nodes to specific evaluators/devices
13
+
14
+ ### Fixes
15
+ - removed dependency on SciRuby distribution for the pure ruby evaluator for better compatibility
16
+
7
17
  ## [0.4.1] - 2018-06-17
8
18
  ### Fixes
9
19
  - [OpenCL] disable program writes to /tmp
data/README.md CHANGED
@@ -127,14 +127,14 @@ Note the difference in named and optional parameters
127
127
  Python
128
128
 
129
129
  ```python
130
- w = tf.Variable(0, name='weights')
131
- w = tf.Variable(0, 'weights')
130
+ w = ts.Variable(0, name='weights')
131
+ w = ts.Variable(0, 'weights')
132
132
  ```
133
133
 
134
134
  Ruby
135
135
 
136
136
  ```ruby
137
- w = tf.variable(0, name: 'weights')
137
+ w = ts.variable(0, name: 'weights')
138
138
  ```
139
139
 
140
140
  # Shapes
@@ -149,31 +149,31 @@ ruby supports symbols for specifying data types, nil can be used for None
149
149
 
150
150
  Ruby
151
151
  ```ruby
152
- x = tf.placeholder(:float32, shape: [1024, 1024])
153
- x = tf.placeholder(:float32, shape: [nil, 1024])
152
+ x = ts.placeholder(:float32, shape: [1024, 1024])
153
+ x = ts.placeholder(:float32, shape: [nil, 1024])
154
154
  ```
155
155
 
156
156
  For debugging, each operation or tensor supports the to_math method
157
157
 
158
158
  ```ruby
159
- X = tf.placeholder("float")
160
- Y = tf.placeholder("float")
161
- W = tf.variable(rand, name: "weight")
162
- b = tf.variable(rand, name: "bias")
159
+ X = ts.placeholder("float")
160
+ Y = ts.placeholder("float")
161
+ W = ts.variable(rand, name: "weight")
162
+ b = ts.variable(rand, name: "bias")
163
163
  pred = X * W + b
164
- cost = tf.reduce_sum(tf.pow(pred - Y, 2)) / ( 2 * 10)
164
+ cost = ts.reduce_sum(ts.pow(pred - Y, 2)) / ( 2 * 10)
165
165
  cost.to_math # "(reduce_sum(|((((Placeholder: * weight) + bias) - Placeholder_2:)^2)|) / 20.0)"
166
166
  ```
167
167
 
168
168
  breakpoints can also be set, block will be evaluated during computation
169
169
 
170
170
  ```ruby
171
- a = tf.constant([2,2])
172
- b = tf.constant([3,3])
171
+ a = ts.constant([2,2])
172
+ b = ts.constant([3,3])
173
173
 
174
- f = tf.matmul(a, b).breakpoint! { |tensor, a, b, result_value| binding.pry }
174
+ f = ts.matmul(a, b).breakpoint! { |tensor, a, b, result_value| binding.pry }
175
175
 
176
- tf.session.run(f)
176
+ ts.session.run(f)
177
177
  ```
178
178
 
179
179
  ### OpenCL
@@ -187,18 +187,39 @@ Also include the following gem in your project:
187
187
  gem 'opencl_ruby_ffi'
188
188
  ```
189
189
 
190
- To use the opencl evaluator instead of the ruby evaluator:
190
+ To use the opencl evaluator instead of the ruby evaluator simply add require it.
191
191
 
192
192
  ```ruby
193
- require 'tensor_stream/evaluator/opencl_evaluator'
193
+ require 'tensor_stream/evaluator/opencl/opencl_evaluator'
194
+ ```
195
+
196
+ Adding the OpenCL evaluator should expose additional devices available to tensor_stream
197
+
198
+ ```ruby
199
+ ts.list_local_devices
200
+ # ["job:localhost/ts:ruby:cpu", "job:localhost/ts:opencl:apple:0", "job:localhost/ts:opencl:apple:1"]
201
+ ```
202
+ Here we see 1 "ruby" cpu device and 2 opencl "apple" devices (Intel CPU, Intel Iris GPU)
203
+
204
+ By default TensorStream will determine using the given evaluators the best possible
205
+ placement for each tensor operation
206
+
207
+ ```ruby
208
+ require 'tensor_stream/evaluator/opencl/opencl_evaluator'
194
209
 
195
210
  # set session to use the opencl evaluator
196
- sess = tf.session(:opencl_evaluator)
211
+ sess = ts.session
197
212
 
198
213
  sess.run(....) # do stuff
199
214
 
200
215
  ```
201
216
 
217
+ You can manually place operations using ts.device
218
+
219
+ ```ruby
220
+
221
+ ```
222
+
202
223
  Note that the OpenCL evaluator provides speedup if you are using large tensors, tensors that are only using scalars like the linear regression sample will actually be slower.
203
224
 
204
225
  samples/nearest_neighbor.rb contains a sample that uses opencl.
@@ -3,7 +3,7 @@ require 'tensor_stream'
3
3
  require 'benchmark'
4
4
  require 'pry-byebug'
5
5
  require 'awesome_print'
6
- require 'tensor_stream/evaluator/opencl_evaluator'
6
+ require 'tensor_stream/evaluator/opencl/opencl_evaluator'
7
7
 
8
8
  def tr(t, places = 1)
9
9
  if t.is_a?(Array)
@@ -12,7 +12,7 @@ def tr(t, places = 1)
12
12
  end
13
13
  end
14
14
 
15
- return t unless t.kind_of?(Float)
15
+ return t unless t.is_a?(Float)
16
16
 
17
17
  t.round(places)
18
18
  end
@@ -23,8 +23,8 @@ srand(5)
23
23
  seed = 5
24
24
  tf.set_random_seed(seed)
25
25
 
26
- a = tf.constant([[0.2725329105980846, 0.3880147479879318, 0.24085470438233492, 0.6811602403625188, 0.8107789671728161, 0.8241574157469488, 0.1414313550335693, 0.3560018330283453, 0.021245700634197617, 0.8578553307153541, 0.6043588436393377, 0.8865528275668552, 0.3006896129454083, 0.2918507430008608, 0.14508330528645497, 0.11712850362546678, 0.3571417788470822, 0.33336165788451155, 0.47321049561412765, 0.214542527647141, 0.3699729728853637, 0.2319467079595129, 0.49125209864920105, 0.1959392743488475, 0.5716187505958716, 0.007197536905300672, 0.874113007634974, 0.1881228431773776, 0.21680426412453935, 0.08681687104236258, 0.030958566067234905, 0.23702004177358216], [0.5807776076471772, 0.8058593996884935, 0.8883616444998323, 0.35245912133691026, 0.26695996523990406, 0.6193624322488341, 0.5474161252558224, 0.49677875482358347, 0.10114620639938365, 0.6993832976297623, 0.7785053697582122, 0.994227689116567, 0.5630721169855526, 0.68097175382061, 0.16189610111136787, 0.7462663411068147, 0.028797111810075826, 0.9640680212216772, 0.8071587776351983, 0.8551338941444634, 0.7393947743570277, 0.03719533975600353, 0.17656487515749086, 0.7467725229822616, 0.8803246786936447, 0.20534736240632945, 0.8704258422365688, 0.3413825557692479, 0.832883227809196, 0.8965458949082973, 0.4703108328908656, 0.039488539621647445], [0.03861515218106637, 0.04423484781457354, 0.8777546108773377, 0.45635110835963166, 0.5572025895439544, 0.011297942987489429, 0.38087796951759456, 0.5649433996662816, 0.46323362071357355, 0.31624760021536136, 0.8687374199866639, 0.5439830634305236, 0.5235063961425092, 0.6045265062655065, 0.4667020302877082, 0.3441894829976254, 0.9280733502876333, 0.9124845719788551, 0.8162451145213555, 0.7963841345318957, 0.8685288873951795, 0.26499894776711186, 0.7732080890101195, 0.4182116391088625, 0.8882481779251242, 0.719658503516954, 0.11649225952661735, 0.650535627356098, 0.60237062122146, 0.4408944865686434, 0.5719546844399085, 0.8117677738497747], [0.7416049367855905, 0.12583079736388525, 0.7363723228650658, 0.40468085671890075, 0.2650812542441058, 0.29725204637304803, 0.8870646691202547, 0.17313219852128714, 0.4072206452039151, 0.3109832079485291, 0.2769712791934442, 0.7497516722395041, 0.3951522710869563, 0.23015713833238094, 0.3703201654413373, 0.5622127674027964, 0.8859793557725363, 0.33604821696987686, 0.8025224230986084, 0.13535422060341085, 0.13027688786946556, 0.21595574789695582, 0.32941723620421126, 0.5171583478640247, 0.4033276347913761, 0.9643975816972933, 0.6473431547760975, 0.2859163011575172, 0.9461465774531679, 0.9782578080930022, 0.42673349143037165, 0.9149726809577815], [0.847726198720607, 0.580910811265692, 0.7990133312093065, 0.535063724712992, 0.21251835156018428, 0.27570475972181185, 0.5729814342686013, 0.9894115570400424, 0.31962130227681806, 0.09955368748889437, 0.9360451062281807, 0.7909115969806331, 0.47555373873994355, 0.5947730054504421, 0.5343962067962027, 0.4743767713876763, 0.906291790739421, 0.7216548199745315, 0.7440300668954148, 0.7499051988484967, 0.22522695247135194, 0.3685144833289663, 0.860000177370091, 0.9139378863264888, 0.1485168991852579, 0.6581251861975935, 0.9690730735056017, 0.940009588957691, 0.13719041051467906, 0.38724392228069515, 0.7372388880930032, 0.06797009341082538], [0.7249058905000767, 0.020105757607978947, 0.2560574188903417, 0.9662024116598845, 0.8722138358384874, 0.8683680853103942, 0.4891431626573485, 0.640120366995875, 0.9740548483130856, 0.8548975133724599, 0.8366334078413639, 0.8098814871129698, 0.24286051216518567, 0.3105778029681081, 0.26886419717699583, 0.6345074515199324, 0.28975976680258286, 0.2229759770121189, 0.5319973171302538, 0.5765018230647625, 0.07459429911423676, 0.7438406276492094, 0.6253093796933693, 0.7548443352685654, 0.4004224859513238, 0.5148230127140149, 0.3745489169050835, 0.5509510028659566, 0.4550113148699043, 0.5723466571353021, 0.970682655685505, 0.34130513666586815], [0.3764328342733121, 0.8943676141368968, 0.5258604249346529, 0.2672543630694535, 0.2591528975331201, 0.9355339568391214, 0.3947627149045697, 0.4457918184631279, 0.23005511145010016, 0.9938306107128754, 0.8181527369398519, 0.5032047031941392, 0.6669112292224882, 0.7394176036419358, 0.9376145940573779, 0.6686130257304471, 0.8952103330991765, 0.07708651615198725, 0.6189035736644876, 0.8875581596271538, 0.46088139695538777, 0.9458974310763114, 0.5664138883933191, 0.5184988321752187, 0.4217816078215335, 0.4175701919105893, 0.8461691843104434, 0.6822285100627765, 0.1443789272640701, 0.4913161369821776, 0.23747023845438153, 0.7654234628487949], [0.5575872905103103, 0.8094485971852966, 0.22854380699068988, 0.6807419664218652, 0.27778964492085834, 0.13540725992964886, 0.42579567302469334, 0.49275856677109164, 0.31986442131742265, 0.3448773376026849, 0.5075796516367193, 0.450704372157809, 0.7894188277173837, 0.13872941919315052, 0.1233744884536907, 0.5478681971326325, 0.09524187874953993, 0.7624348969302654, 0.5209594093617309, 0.9610115746004823, 0.3810202654016055, 0.09160878328490796, 0.7772293940110021, 0.5094728248567474, 0.6464968911223922, 0.7067703254668071, 0.23303151021392932, 0.9657366653367108, 0.644439469511093, 0.8827535348486298, 0.6000805598584132, 0.9840190834593527], [0.7919230029577806, 0.07614750065011566, 0.9052074427291401, 0.836099585331769, 0.26414324374498166, 0.7855155918833074, 0.34503055753922585, 0.03862893466146455, 0.12527810136656237, 0.7793642895804046, 0.4872803654747767, 0.7038877703915003, 0.13213472457993936, 0.875270464790616, 0.890412419659819, 0.01701415012869245, 0.7218498198334101, 0.13950312068772097, 0.49867647783589786, 0.577717391387338, 0.5073986349610653, 0.8767267264028988, 0.38440128236780435, 0.9231968748663124, 0.40195934771559794, 0.08435206086990998, 0.590905677210973, 0.10543499534781464, 0.9462260716626316, 0.024139758120744537, 0.09145558211409888, 0.681607423764777], [0.42705279478570213, 0.3550467386922511, 0.8802814742648007, 0.5461343154534873, 0.9441173303821807, 0.09404472153852017, 0.44581805344081227, 0.6383957203852649, 0.55033182439838, 0.25001673323912976, 0.014245818202592186, 0.33635437977603566, 0.040021673551206116, 0.11287585999524963, 0.8441801662333854, 0.7464433773351975, 0.16983055265981084, 0.668205229620468, 0.46617854056303687, 0.5528067890889518, 0.4608268439525087, 0.8516726962353337, 0.33953070991626, 0.009029727290305267, 0.327536752185137, 0.9253380173986988, 0.26239999986338236, 0.3898249217299008, 0.19890469034282854, 0.9195791632402764, 0.0683044334873062, 0.19507810520854907], [0.04309609494575317, 0.43718111133546655, 0.8125736240962521, 0.7588880304646177, 0.027040973418408276, 0.3314643853889815, 0.29181049801309766, 0.16223840889181673, 0.3137752714358808, 0.8085588187402414, 0.8245334555073797, 0.7314084938296418, 0.011162838653172802, 0.7991705817142671, 0.4215808565872736, 0.9891458050373564, 0.9416467398915616, 0.13613670863302774, 0.17696453969007642, 0.773397760323165, 0.0589252396488541, 0.10835064871322442, 0.9150125793065705, 0.351060975798858, 0.27583704689764743, 0.18120974711224902, 0.7399819505423607, 0.21719296597532245, 0.506490592539078, 0.9785243277566964, 0.09726502593788422, 0.4671530781179789], [0.6410854535115909, 0.6253957319163763, 0.8902302023362296, 0.136739015910759, 0.3748019264633674, 0.8662768868335823, 0.8649380570461478, 0.7531927093655032, 0.9066753259669115, 0.5703306532241119, 0.16583039366230667, 0.701189786472272, 0.38107252088551047, 0.9813418058106119, 0.886938700974709, 0.998508086661768, 0.3061356216004164, 0.8169216106965932, 0.9812771238487481, 0.035365203176594084, 0.5988281981561955, 0.1842638661080379, 0.27049123480446935, 0.1353638384650322, 0.5431019248413402, 0.4080436027747243, 0.3800642187821912, 0.8864143801177694, 0.4708195582858189, 0.830594229182061, 0.7899139970834116, 0.1572259042046077], [0.9185310234170346, 0.4767806181890818, 0.08449644168831194, 0.7385202552485736, 0.7075559265588275, 0.5652837764282266, 0.9008455981775205, 0.9025683022545035, 0.05829147039949367, 0.8372509636962329, 0.588991323160694, 0.00022116030183705337, 0.3711074272834517, 0.5979401793064955, 0.7406932456793297, 0.6210188746049686, 0.49514847630904923, 0.9262925461670788, 0.57896797994365, 0.7501617849662162, 0.9846821183877265, 0.1603142628889479, 0.5698724645993117, 0.9233834981987927, 0.9258783039461104, 0.1375247841694881, 0.7698032876261135, 0.3778524783541575, 0.15641439243632937, 0.04379401045626863, 0.017857652706636307, 0.8675918596426042], [0.06450418315397, 0.8922114965959638, 0.24073742991567526, 0.2434820404661283, 0.7684221013177507, 0.6537579633777831, 0.7271786189701933, 0.48026226683177764, 0.14692995868578884, 0.023330423789140187, 0.19726123812219387, 0.5897078826890374, 0.82686005745901, 0.6777038657008554, 0.6840599599896263, 0.5522749483816388, 0.10692230895694155, 0.23896811653555583, 0.5546032440891485, 0.18496410110277817, 0.008156708395089751, 0.8770820052336389, 0.7510109527088352, 0.8245485039800774, 0.030812017181307993, 0.6875549998972814, 0.3904576079605495, 0.276961953152964, 0.059532989813253945, 0.7176193028662499, 0.3270658901016591, 0.43741226845648684], [0.7340915945386737, 0.5201616205351828, 0.5485112678777208, 0.6574808340628616, 0.15820793574978698, 0.4747871107701428, 0.21814992207784667, 0.3053735810270253, 0.9978818947555285, 0.88086714390294, 0.5924054809427372, 0.06847945294226376, 0.6872934903873835, 0.9867672476320251, 0.9494785581850725, 0.21654473839196253, 0.8303039433262708, 0.3230645345784833, 0.6694144509139895, 0.6157144613080398, 0.8418416769348557, 0.22946674654921528, 0.6886788751656463, 0.520899891586266, 0.1190039388254015, 0.8390704817167567, 0.6138578383243984, 0.7956760189282175, 0.5476937761772018, 0.23298043297945203, 0.198174282849076, 0.4491101509618899], [0.15113066404994535, 0.45410772002901634, 0.3593440026106136, 0.037246391090193565, 0.7053538892518034, 0.15790620304604785, 0.19998376162010767, 0.2974111252964282, 0.6345210813526903, 0.1763587509003961, 0.1310558226410894, 0.9584241312539243, 0.3008015928653863, 0.14891060185385874, 0.5685887120769865, 0.15915309559697566, 0.7636628666754517, 0.4134391866308862, 0.786128592829847, 0.2977960277839361, 0.2058706549626531, 0.5841138609034956, 0.4729970861879388, 0.5985880901975952, 0.23374130811959803, 0.514908374339887, 0.8886017532599835, 0.29978640864985395, 0.6165878682678793, 0.0016482799927018954, 0.8649987868350894, 0.971369525176611], [0.6757948836516618, 0.9887731501943787, 0.4836519339148717, 0.15546025440167266, 0.17173379528107335, 0.5533178551425013, 0.29800031725496046, 0.4493964136574614, 0.7026379108846528, 0.5824706278279046, 0.5220095729005545, 0.17174841471041746, 0.32676331062745123, 0.40472150496228254, 0.9986819507127378, 0.4083665962596269, 0.957311485668378, 0.7168621651201634, 0.1938224820081237, 0.04589969617727474, 0.3758733067845704, 0.5957047487228161, 0.08492685319957871, 0.21068708189145335, 0.35621807673734207, 0.02047005200825458, 0.6503331445536848, 0.9012147170557808, 0.11414206622237844, 0.48944070127337114, 0.8713326686700201, 0.5382579854577976], [0.6294025396637645, 0.937234705875601, 0.6818839241632989, 0.4192617338440111, 0.6961728252882201, 0.32397961884915905, 0.24674294501857208, 0.48513888398067484, 0.17135264460032196, 0.08191281667720829, 0.1432336027275748, 0.328016995971681, 0.676425880704612, 0.7455812902657197, 0.963630610086166, 0.23639783118345892, 0.7959467050453083, 0.8601083615450156, 0.7426807255331401, 0.2555762622707157, 0.4512429882891241, 0.9112985273748532, 0.7077248405767299, 0.2743843792265346, 0.5967900234092368, 0.032657620054051484, 0.07630431011240635, 0.62591933822758, 0.16689085829669648, 0.781922793463378, 0.1621605762907543, 0.04459621889538268], [0.6034549352924006, 0.8358978354941751, 0.530672141383359, 0.1372791343005163, 0.7495997481113197, 0.8662603307550838, 0.1997131616328347, 0.6419587000467564, 0.8090726522009262, 0.24303945091174328, 0.38205226979445583, 0.2996699316559306, 0.5285870013677434, 0.8758721756091844, 0.9673404885731881, 0.8278225181250354, 0.05007791887344604, 0.787333621013861, 0.7298224149783654, 0.2725186159280736, 0.276930548457913, 0.00973831750055365, 0.08990968481930728, 0.2839293700563972, 0.10441707420551694, 0.10640859057466145, 0.557558727644024, 0.5365099209302313, 0.7368053199644672, 0.247349389363951, 0.9299430646671016, 0.9496700199886788], [0.7845759605345203, 0.8007377981761993, 0.22878457906060268, 0.4001170825481377, 0.825223943057333, 0.9342944323456298, 0.6491477649962875, 0.6647364881250676, 0.12238309223323784, 0.6172098364497233, 0.9531953412088049, 0.5324166456329136, 0.5315712938805236, 0.23780563444070502, 0.03497614982557162, 0.8087951559682279, 0.4051376455837472, 0.9092960620855645, 0.5441692611385683, 0.8513028871355914, 0.21369584203457126, 0.27253983442078256, 0.19928373176221903, 0.3524134348157939, 0.6479257525899085, 0.2526821596714067, 0.40595594373801247, 0.281968015390033, 0.7873282314260711, 0.854813559823666, 0.2827597186540255, 0.38745471123774466], [0.6638216539079878, 0.20236666903401268, 0.08639352622495977, 0.349860026309993, 0.6066594871764246, 0.9503320384561643, 0.23705458946220048, 0.23598159375921723, 0.856472580268192, 0.41463280108763256, 0.23341863715336764, 0.6519257838193881, 0.7518033077994175, 0.8339521339556639, 0.741006750477488, 0.8020541898403933, 0.20523192201353513, 0.3236515629479352, 0.8042221812480973, 0.7534550597360676, 0.46480770249944736, 0.32536329545332643, 0.7364471797125913, 0.4205163898488501, 0.4903554326169385, 0.840912691405158, 0.8655380473233405, 0.7071898338123007, 0.5317931038099842, 0.8559138372164496, 0.7994324466079666, 0.2880749842558825], [0.24550018504111248, 0.5756660213437707, 0.6765389084896878, 0.6260456248020276, 0.7225036569814841, 0.12400057759790561, 0.22628528195525732, 0.022010741589582716, 0.08838736112569823, 0.011163911847832386, 0.3216210491621768, 0.08175147587745313, 0.7624936195673231, 0.25778591649271354, 0.6692942394883513, 0.6973846723434288, 0.30950565556938436, 0.2498216087006182, 0.6812376949626454, 0.5576017508045287, 0.7412632095114141, 0.6303402285214498, 0.7793229236723628, 0.576418884685342, 0.8685762308126492, 0.21554254156925656, 0.5755497474597179, 0.5427592682517937, 0.013690407766141721, 0.18583747932500738, 0.6185119746628217, 0.35307800168210157], [0.566998842156229, 0.04252289956283306, 0.06731158791222025, 0.26593966513634637, 0.7076412605116443, 0.8559332578099194, 0.018616848774105077, 0.16838420127747644, 0.2037390256823325, 0.3647754681474249, 0.8169130904283054, 0.7498593499704438, 0.3183903815593988, 0.23137248888549544, 0.04250235168794325, 0.11553412222598736, 0.911952490242314, 0.9687337045657332, 0.992320698151797, 0.18375849743371342, 0.879130257657083, 0.9131203622730579, 0.848285378928514, 0.4184466215756286, 0.48872224356814087, 0.5447709807060884, 0.5175422453857609, 0.17394657523211554, 0.5724408990888996, 0.39636728575795943, 0.25053189591704494, 0.061171464920405594], [0.29432434477886793, 0.18910444727227294, 0.3183996461882874, 0.8154617748228543, 0.5403260847560448, 0.49644435294914513, 0.06651614167102637, 0.42013484758853914, 0.592389299494172, 0.7485275398488429, 0.6920575405941224, 0.6081271084211796, 0.8459986623397419, 0.3148894887129141, 0.313335538450613, 0.03150174172420939, 0.06344205071136277, 0.11049480263490385, 0.3438196888031825, 0.7789379594969429, 0.8461034528016953, 0.1777828239607896, 0.23966316317986391, 0.11058811923342882, 0.4612004624162698, 0.6248437636956888, 0.4139651333860682, 0.2437309318609585, 0.26940215088653374, 0.5834532842716483, 0.7553854766838455, 0.8870003440004377], [0.7131021119761023, 0.8455447366625631, 0.4464314828758241, 0.8133059482465473, 0.958304169843246, 0.33488064061132805, 0.29398099895351315, 0.13974875768415818, 0.7589127706989394, 0.3598214164689374, 0.9461161471609665, 0.910652915699691, 0.9095081273759329, 0.888594602091207, 0.04689291386340688, 0.1357957386523687, 0.922620398612973, 0.5857936773764779, 0.3927858977229661, 0.817869216849458, 0.297332709708661, 0.8272257010186305, 0.05292689443321341, 0.10514574519482212, 0.36578515932554156, 0.8500865702652749, 0.04207284009657242, 0.3819859701652978, 0.8912934764631749, 0.6309903352506815, 0.018131259064879446, 0.47930404031335294], [0.5457371845495264, 0.8712404238659666, 0.7247721046657654, 0.07338406434382128, 0.274465331655004, 0.22977468943755763, 0.420775749877346, 0.3508825312498094, 0.2718209933837674, 0.9768220116450878, 0.9303355491203692, 0.5862976236863553, 0.0364201780674841, 0.03634762699267058, 0.9705923634503445, 0.9271701917187813, 0.10243715345560411, 0.04488627641842913, 0.30564718481295416, 0.6938916470542316, 0.687533528757273, 0.1531037503429673, 0.9569926387528904, 0.4456868394993555, 0.6935217684187607, 0.47558360847230463, 0.5833535689083245, 0.22331116275491858, 0.12774778748975013, 0.5611590744641959, 0.37369583174744814, 0.6911802838579308], [0.27317296287538473, 0.2878774647725084, 0.9665228103042603, 0.15831409542954877, 0.14095346036041678, 0.691057581009555, 0.19597316548106647, 0.2698893275759011, 0.22994938883329563, 0.3650328961353234, 0.03455604539868251, 0.15018838803537715, 0.70654440338894, 0.8432193780288478, 0.4501108104678656, 0.24880816981432907, 0.4113477051823211, 0.13718550433170984, 0.10922791807204213, 0.24718916923494216, 0.2105229590819897, 0.6723307581640369, 0.9463455449215746, 0.3328818421838817, 0.781496192399278, 0.19877502590796214, 0.6837831855534533, 0.5130448559559802, 0.6903581980211436, 0.3345818207579896, 0.27391450998864186, 0.33297423210091925], [0.4789133697318564, 0.1883291554626083, 0.14263194896348497, 0.7476350925895439, 0.3345968936751935, 0.6311909452655711, 0.9158961979980647, 0.2690747871227518, 0.905544341756655, 0.4023966521351158, 0.637874754372268, 0.679061615059659, 0.9822014176429255, 0.7074216507615386, 0.6852523610612978, 0.986372955071284, 0.9760855027510825, 0.45300020772084704, 0.39604509581144764, 0.20384962752740543, 0.9923367776652224, 0.3958409138520709, 0.7815530773311689, 0.0007082257117458912, 0.26924546205785405, 0.009017138199075458, 0.1649340794217895, 0.7820384500228016, 0.8535381399904465, 0.8491840498104947, 0.43299589559734386, 0.10546019419018826], [0.19279935986840502, 0.1570851253645389, 0.6732964572430329, 0.4619390623066152, 0.2638204206348629, 0.7675231713905503, 0.25612409735408326, 0.15477950956356257, 0.9434990458255896, 0.9762922148304488, 0.9871088071881459, 0.3919744724635428, 0.8662262477924317, 0.32665874270066797, 0.8300460759100673, 0.9158564628368425, 0.98261858394892, 0.8506511254344691, 0.9203453353031872, 0.04515043377665562, 0.4275743183100933, 0.5290194672755016, 0.620659963905625, 0.14301188126047837, 0.23486884433433186, 0.3940762266722434, 0.11525353404902172, 0.01091024780183969, 0.4541207167811333, 0.2906507520546029, 0.4681217314825199, 0.21710022760843217], [0.3845292454575443, 0.3294127318319673, 0.01797842738958466, 0.7198238767504441, 0.6503316648496394, 0.6246053826080051, 0.5339014951120539, 0.4964338335668361, 0.7674830544730749, 0.638772544418624, 0.016561347444315033, 0.35165328325150036, 0.16387655480950292, 0.8780201148494179, 0.8686626391623826, 0.8761847417068875, 0.8477607230924772, 0.6263719237153387, 0.9289557271387174, 0.20087220716444387, 0.7270623708078868, 0.7064474294427389, 0.8480410536887238, 0.07671616910690748, 0.4432848556125629, 0.43412617614050664, 0.26590694107181656, 0.4305689993597329, 0.4566154217724854, 0.3155931423060099, 0.22010763976676928, 0.8207175627266062], [0.13971229099847737, 0.2610874253216867, 0.3717456285981827, 0.413524544703314, 0.9054138485325622, 0.9903801717330138, 0.8709602586438792, 0.5739604683423059, 0.1061710403984284, 0.07497642567957152, 0.035527319473867225, 0.7239119847427742, 0.7030599867732227, 0.6718009840480704, 0.4114241680142183, 0.29790003540671617, 0.2707478411851091, 0.6540102534127415, 0.46610605716247966, 0.4098776529738265, 0.7812168889088276, 0.5833935160308726, 0.378960200396254, 0.782253271995672, 0.8401467184256772, 0.9982085324006608, 0.8700484000917069, 0.554548831531808, 0.743687321877366, 0.46936873194331274, 0.673603891377619, 0.6420071614485556], [0.9328363675221355, 0.39349241172465244, 0.8412400392598355, 0.7178220859421464, 0.03734010918109043, 0.13677855026985142, 0.8529596709852738, 0.41567940522758995, 0.28259688618589396, 0.6295108495235522, 0.8240809980216333, 0.4529962390650004, 0.6663634390771984, 0.8507471354254514, 0.09652076626784611, 0.2533202229912215, 0.7564265535210644, 0.5926726029824504, 0.5424938044272088, 0.2590517744269266, 0.03014345790964401, 0.08869371688621697, 0.31902651490981204, 0.7370910857491809, 0.2968393245173979, 0.38031036979530475, 0.6223097416838929, 0.6759657574101832, 0.3074967217668195, 0.08307009535455323, 0.9911559124950241, 0.40631713223556576]])
27
-
26
+ SHAPES = [32, 32]
27
+ a = tf.random_uniform(SHAPES)
28
28
  a_int = tf.constant([
29
29
  [1, 2, 3, 4, 4, 1, 4, 8, 3, 4, 1, 1],
30
30
  [2, 2, 3, 4, 4, 1, 1, 1, 1, 4, 1, 1],
@@ -40,15 +40,14 @@ a_int = tf.constant([
40
40
  [4, 2, 3, 4, 0, 1, 1, 0, 0, 2, 1, 2],
41
41
  ])
42
42
 
43
- b = tf.constant([[0.9410340772316699, 0.06698804110682166, 0.2711435869675701, 0.1958611282491458, 0.4893257926565766, 0.8785122481286308, 0.923802953058796, 0.037894487106367225, 0.3676599227662737, 0.4172736904372416, 0.45408328418148936, 0.5847808054435385, 0.4696944521791402, 0.01513503489948742, 0.6138166411721849, 0.972752605021886, 0.21848144460419416, 0.5686172124684074, 0.10521079784867704, 0.6025324775255201, 0.7096093436782706, 0.7166235085625797, 0.7912777437775904, 0.8700586023162462, 0.4272843987169266, 0.4559582914495681, 0.859734601373069, 0.9657589847279586, 0.02152968502176078, 0.919538961393785, 0.555456155463116, 0.44046823207425556], [0.5898280754664369, 0.21664983406221738, 0.5371658145211907, 0.33533133624852984, 0.9379677592322764, 0.6758346851608819, 0.8403821399416298, 0.5561037132312183, 0.5633356902777996, 0.8611392055154341, 0.45018465113574646, 0.6780608857171807, 0.9388964101422289, 0.9899315603074287, 0.3447361871428608, 0.6096241010090331, 0.8047772660043945, 0.23871305382292918, 0.3201877019375067, 0.2745838287624307, 0.6947759767969041, 0.5721601033289561, 0.041970050337021725, 0.703380252360758, 0.8893348119300204, 0.9517695102005576, 0.25366843529388294, 0.14250921129777883, 0.3333361121276205, 0.32951899028354004, 0.5411984051515276, 0.9069956155232997], [0.281679076841548, 0.3022597737282968, 0.4312403089115744, 0.28794490776691295, 0.48810678480160385, 0.6017798370508892, 0.08484039833819423, 0.7169060825716232, 0.3971325155758131, 0.29917765187918943, 0.5171234281020269, 0.7691517685867635, 0.3312068954182815, 0.5349114973645429, 0.4492987971287693, 0.8659784069325879, 0.7745759635873488, 0.5114037737284852, 0.15109462955279807, 0.23761201917611263, 0.7104141716573457, 0.7681171750537387, 0.22790264830507423, 0.5289273782110677, 0.63554608901305, 0.03817363481703617, 0.7876374482752528, 0.7081496036953007, 0.5983792190966924, 0.4357353674652844, 0.615484467610345, 0.920113710586996], [0.3333155207754781, 0.32717367002532216, 0.8400345546298748, 0.8047653246375557, 0.8740060807574792, 0.33251055314578204, 0.7262937238563125, 0.9632570732066662, 0.9564023097552159, 0.09263287751336435, 0.9781006987155845, 0.11663510870468907, 0.2179228374997758, 0.21100884194674574, 0.5063287641731697, 0.14376586780949685, 0.1534601526156465, 0.46878688645022737, 0.3274593200258956, 0.807806446074887, 0.5587027014536805, 0.5935367585230817, 0.5880872420420287, 0.950100812879426, 0.4113497883912699, 0.5976702083003979, 0.388712153356796, 0.5429864077813185, 0.8001477133094786, 0.8069296196979817, 0.5766727786422597, 0.6149205141879728], [0.5465672795752728, 0.14652937966458546, 0.977262320110488, 0.7837451585328954, 0.37390117759501607, 0.22406355216218743, 0.08138585933569298, 0.5912917556281199, 0.7917803087117612, 0.0887226914176652, 0.0990983122072846, 0.0812627087453448, 0.16464233734003952, 0.028543110560561358, 0.6176101568603679, 0.9463786517933256, 0.2954073572006314, 0.3770715693265413, 0.8295095030520465, 0.6411508701395362, 0.08524708138863124, 0.9372920774581198, 0.08821136846986244, 0.3801151700033306, 0.9617987277558723, 0.1351527607501044, 0.11453824555091496, 0.46986417934560587, 0.020039025221080364, 0.3002362947162044, 0.06058805597967876, 0.25730054295596605], [0.029766148343562948, 0.771476266330445, 0.1268781499362568, 0.43198188087849754, 0.28249323531297943, 0.985756022808159, 0.28283529465093904, 0.9528830245214173, 0.33295334003558985, 0.6144854287263677, 0.4269103726116572, 0.5851384684978556, 0.05199090235691395, 0.15223405732580686, 0.09641568484141572, 0.631342704572998, 0.9034214643952048, 0.14361050602397019, 0.28561763889744873, 0.24912906203690244, 0.9000810235437534, 0.33163857232220595, 0.7643632985578201, 0.07946094068117637, 0.48038887208090497, 0.5947107596015285, 0.2407715579595021, 0.8957507376251586, 0.42106805136642256, 0.9637908836886113, 0.6003998350297448, 0.12369689819541352], [0.07161213678414391, 0.9196973705055909, 0.6251445682508778, 0.5949853715770408, 0.4472897580828916, 0.788807050304436, 0.2650321731158549, 0.959799350829074, 0.9728206437972438, 0.3291371619516168, 0.0961957220196834, 0.18685582389386957, 0.03772593190951312, 0.16764034150091078, 0.8974950693981565, 0.6669701000052681, 0.025146848533914468, 0.9362372834299912, 0.7063605822530274, 0.5374888334436, 0.5616579496734609, 0.366328437217877, 0.8711589004616117, 0.40770083268374846, 0.7302142089749507, 0.9110046062548499, 0.8817032474485756, 0.08333063947260566, 0.7542191691661042, 0.293014955634084, 0.09816625180695382, 0.8306309768608124], [0.8061137158989344, 0.584314773585206, 0.8850764131693849, 0.9610828110079029, 0.5634731512248438, 0.2348974826495236, 0.9055546642084098, 0.8503734587536229, 0.08803274319800813, 0.7581436068864915, 0.8314163763493402, 0.8017288801517272, 0.010954795913874937, 0.6740430834610042, 0.6577121384259258, 0.4239960931912531, 0.7463405040981885, 0.15178970112370693, 0.8288551929660809, 0.33358400664033705, 0.18508734985000996, 0.7084353815190327, 0.261474079427774, 0.11649380495170703, 0.057763608972749236, 0.5751210164604889, 0.4877943340856312, 0.8988713757525498, 0.052184398177830604, 0.5259644712011993, 0.8072728159259359, 0.15502470484372066], [0.7201490196260991, 0.6196207657677387, 0.6440657803300438, 0.02674170068167181, 0.09943381061236412, 0.8753973941183256, 0.8959697899227773, 0.648221506693197, 0.9003419408702636, 0.09348893677747983, 0.8538834287343233, 0.725781213686971, 0.10325652658540119, 0.3737778994376213, 0.5064845614065397, 0.5954676293970826, 0.17170744625864898, 0.646954487325341, 0.33660850832693634, 0.6797863362923902, 0.8754703811364473, 0.15288650758852218, 0.03082007903712658, 0.3782812523000626, 0.4967937190985219, 0.24796669928239223, 0.16656888994085806, 0.60968373108479, 0.9797750813967814, 0.9272446855724417, 0.36818010127129086, 0.14064828279815433], [0.0191362473712966, 0.881703318959738, 0.73750737842266, 0.9344250439341003, 0.0380965633498922, 0.42652865330544065, 0.5337943685274654, 0.3574985086253277, 0.19348499375612882, 0.9525512370354067, 0.8130663186314758, 0.6865625067583948, 0.38128832611401253, 0.20470762760454697, 0.7026705642050611, 0.7859634245010417, 0.039064991281285155, 0.7017531552520212, 0.9269374090208229, 0.7647166800820503, 0.6948337488897096, 0.8180614660099139, 0.15053827043035817, 0.09244270510585595, 0.3964046101481592, 0.0062967894617379505, 0.9550842247356682, 0.1952322745692352, 0.6886909583731162, 0.357934656398877, 0.5709941164466898, 0.8862864011376151], [0.1532062672204727, 0.6713751267991998, 0.23654534264131732, 0.7620886696207012, 0.859727061102344, 0.03969079209037618, 0.4385968830577761, 0.6034986304151705, 0.5185506102732338, 0.46971545171843165, 0.3376533963619154, 0.6432398642355255, 0.32567751367999687, 0.9840112644753473, 0.6813670157244995, 0.7220286371477305, 0.051025190776205154, 0.30891075041852223, 0.621435378701943, 0.4469224375263344, 0.9963492575995735, 0.2062574159838072, 0.15624552606520348, 0.633454153546815, 0.55986542919481, 0.8343169149530556, 0.8729507380106863, 0.2510718973505247, 0.954006042076975, 0.44643792601927623, 0.21302761384552094, 0.09631206027889916], [0.5154843892908358, 0.13308389974552814, 0.7200641776565829, 0.9819658469644623, 0.25070556711467595, 0.7810059863834595, 0.5978123107787413, 0.8260127509565302, 0.9083478856560968, 0.5221215554878939, 0.7236764457684198, 0.9093541768047201, 0.937282210688133, 0.24442593908286114, 0.06236066074889457, 0.8041751958538587, 0.9848328630825095, 0.4174665367018775, 0.4072556674000438, 0.7769897415740308, 0.610461967987914, 0.020076194438532813, 0.3026780644419079, 0.13006834993947602, 0.5770875444593148, 0.46084627212953566, 0.828887224689061, 0.8629276365283017, 0.3840820260941076, 0.3684872404340642, 0.9115099553036768, 0.8103616071823776], [0.14253428225043863, 0.5033475883347014, 0.8755688600132693, 0.9474830042181667, 0.33341908921272834, 0.3585762971810864, 0.02459914496652138, 0.46047322306560334, 0.2919926087258491, 0.9297758585678452, 0.44561438558139954, 0.46458079066157343, 0.7215631360300682, 0.21754691527904402, 0.938656521803378, 0.5092489242573011, 0.5019432966520505, 0.42317703296930587, 0.21871575359438133, 0.7469009459168265, 0.7694783432963413, 0.32922372590831395, 0.8858434465046942, 0.2672270974582067, 0.9825625279405179, 0.35510091273427835, 0.0873081823678854, 0.17694367116474552, 0.9382641080463882, 0.7684926642274582, 0.35338300996207406, 0.28545895299373125], [0.038655183707570595, 0.533621883161316, 0.3321012211014829, 0.772528356743274, 0.2825281453662589, 0.25431497583844487, 0.8811587708180842, 0.5854540305551236, 0.9260953186768186, 0.7538059904126957, 0.4983743543954744, 0.24778455834925917, 0.9654614696187367, 0.3644632040800383, 0.3623207878564888, 0.6024642250290105, 0.7887502166135212, 0.12586250550525813, 0.6046785604246985, 0.16227857839818338, 0.9248130726085494, 0.5801589682007237, 0.4463804353304167, 0.6367380621449473, 0.4575101687104747, 0.050606499673423455, 0.610195027049808, 0.07067640675246922, 0.940112935305174, 0.10798409466257952, 0.2730162909252447, 0.27138721210299555], [0.24823113366840333, 0.03873366393079691, 0.7573978638701484, 0.18411247699878708, 0.2501690527395919, 0.08317342672304151, 0.9860415444537773, 0.2664147833103526, 0.4843339855373898, 0.23171679612639007, 0.1476319346666607, 0.7162177737226857, 0.3120696280441515, 0.024767699296932344, 0.44967606184803777, 0.5978354610473275, 0.6025460647675573, 0.72727173424817, 0.9753194407623704, 0.19017512438816642, 0.02677877318172206, 0.49626971664212727, 0.7621846572785527, 0.33389021403441677, 0.19601606118239834, 0.9485795603395506, 0.655502749682127, 0.8266806020401101, 0.8501949135655733, 0.6150768634267608, 0.47264547811292446, 0.8653219169329178], [0.03713674068095185, 0.44160196858742773, 0.6803892112082713, 0.022282826998524796, 0.44380364820127227, 0.8223989324287272, 0.15695068234023757, 0.5116310757533528, 0.6681985130886192, 0.053874646619675226, 0.8412873644300364, 0.1291344988400156, 0.9118553014410788, 0.3172844106219753, 0.6393459342391691, 0.3885172979300142, 0.4419859662437403, 0.49068680837069034, 0.679500727608155, 0.07650215425728968, 0.25354195693587, 0.644098007826917, 0.12448206277373497, 0.9866440740814154, 0.6562645582445584, 0.3561552155973857, 0.02831472738905949, 0.34797813007391254, 0.07751141382658278, 0.38547750830659455, 0.4254528891961388, 0.598071233286275], [0.12721856220003291, 0.010871713360154689, 0.3610328616728379, 0.8880776025440809, 0.5672313233336358, 0.7083573910184755, 0.9347557402465154, 0.6123846302521256, 0.10556226276282255, 0.339432106504836, 0.26593884086521846, 0.35793577279637634, 0.37426342521518874, 0.853316315377925, 0.33661688328648376, 0.7633493761412148, 0.6498575240456902, 0.9188497706349628, 0.05383934968853821, 0.4543596825613475, 0.9772877980118151, 0.5887987643449885, 0.5059582229036929, 0.6490166638014023, 0.21748341551715578, 0.07683552869680343, 0.11114985700366553, 0.9439247935183085, 0.09615860109988206, 0.41918660716872946, 0.6424787486212057, 0.49192326875913095], [0.29390722844975037, 0.2055685645236469, 0.8183646179697642, 0.2303003920203417, 0.5404193484303554, 0.9735672782768755, 0.2687394320994998, 0.6833017120092117, 0.6017832255615686, 0.8369156100033881, 0.6715907113832467, 0.357749670331726, 0.8453363509753632, 0.8091165336335697, 0.8143775992434192, 0.89963505272092, 0.7269870853170195, 0.32298603978623996, 0.3232117334295622, 0.8209549711116918, 0.6664058668192053, 0.42639027394726625, 0.07313575721302745, 0.9391871505887934, 0.65153169059415, 0.5879965785909074, 0.29347034513189585, 0.49060543826794345, 0.7651850029097461, 0.5161473101746495, 0.1649774365230925, 0.34836647552248223], [0.3869589855305918, 0.39632019758886294, 0.7231334008215394, 0.6087821987863966, 0.11161084351125605, 0.7600452692870825, 0.3575616121752676, 0.24451312436977235, 0.4072269586763865, 0.4040390996109441, 0.9930206405959714, 0.3690156731247767, 0.32593995521296915, 0.8850426489247655, 0.8434499536745231, 0.69148918870105, 0.04869537251344369, 0.5221276552749617, 0.15173040947390504, 0.04396980528198691, 0.3332249788722945, 0.4246079149626567, 0.23485989832614518, 0.5431223922343636, 0.529252857055384, 0.9829571884780364, 0.21896817006947844, 0.8910445363523118, 0.49528395975082073, 0.09561089051632066, 0.4613363264347061, 0.2985259483186147], [0.21545185137206457, 0.7981559018412734, 0.25256824600839756, 0.3764102141319854, 0.9292536727474722, 0.5667017748813094, 0.019269130296157844, 0.09125069332461411, 0.9900055621225733, 0.14002488102014676, 0.6779498679635428, 0.9122076311199062, 0.9452450852658937, 0.37085723429004014, 0.9401768904579662, 0.3105754197181304, 0.9839533292554772, 0.7720899778535192, 0.4231668744767989, 0.957180552168816, 0.9366439995098244, 0.540369896103836, 0.3369256570132132, 0.3983245839605144, 0.06022036238515427, 0.5342072424335267, 0.11958206381246761, 0.6141145271451992, 0.2438169093113869, 0.25433049535767316, 0.49560370557919176, 0.6145216709818001], [0.26849242411456664, 0.5330236625427441, 0.08659566177751843, 0.7298927871308682, 0.9637236207262594, 0.3781588503287038, 0.5375007034156261, 0.21710031000159735, 0.10100920382651857, 0.7480839798434754, 0.1582924825815165, 0.404823743114467, 0.9105800718684425, 0.24834025127525527, 0.25998246472548714, 0.5409755294450396, 0.15816402813815522, 0.4466991839097645, 0.022647126673334017, 0.5035583908231404, 0.4537343855532424, 0.7286092449010014, 0.8270800089101672, 0.6965466771807288, 0.6639242501836017, 0.057630767417492956, 0.6966145036216745, 0.7105322839528149, 0.5872682492371255, 0.01142020778092867, 0.07700520136240074, 0.9434779500448216], [0.26088899248621455, 0.48138584476267554, 0.4800027686654831, 0.3283070274155476, 0.7857987352718058, 0.9842444743906507, 0.005898697329637881, 0.2700121882671941, 0.7737500968400121, 0.2968798368026285, 0.6929005523426058, 0.8839622435858889, 0.6271233003586665, 0.3620807070629969, 0.33111214190918914, 0.07560010647401139, 0.1254174221863349, 0.4548081568913305, 0.567696124079207, 0.9260577679777283, 0.9312322503858562, 0.7586990528017796, 0.08395390850219975, 0.009872170172351424, 0.47674128895590595, 0.43475944012507695, 0.8503294089462868, 0.14995812475494597, 0.9963095315808613, 0.22954858573623582, 0.6020031530175132, 0.09129435448951484], [0.6886289109120459, 0.7819207932122159, 0.9010537359223195, 0.14572387605541492, 0.7211871419574344, 0.9299394654887324, 0.08639722471509514, 0.4055115325011306, 0.8375096165324311, 0.7776508962008635, 0.24395303543380586, 0.2629500204889892, 0.268656596803728, 0.46035652743118616, 0.5484182424438742, 0.513574112884047, 0.8088161429401509, 0.7952957771206307, 0.20339970341357738, 0.19014099634001425, 0.7898000098976347, 0.21225670309460987, 0.8489115236228273, 0.890124103047655, 0.21950154976846026, 0.23785974258459563, 0.36802635317592025, 0.3901693503833735, 0.03696529029362372, 0.5828627375396729, 0.8837516652387148, 0.9375790301303111], [0.07839578521097812, 0.3044313646540011, 0.01680449596753497, 0.22622241120012687, 0.3932375126404736, 0.03531420462002166, 0.21143837594590487, 0.014297453489140577, 0.7252552753217409, 0.15289895529250042, 0.3371976003689352, 0.9617963844108255, 0.16140219085964025, 0.833977833176818, 0.14297828144451064, 0.17454293054311154, 0.5935404976343764, 0.2324701610484926, 0.781622904665438, 0.9687950568728734, 0.15412158558340538, 0.1995327147528081, 0.2077640522452311, 0.2374725153756918, 0.6831343217543848, 0.004041878809460497, 0.49547052880736053, 0.6842355073839183, 0.829340229388628, 0.48143204600052425, 0.17209401429822369, 0.9545985730935848], [0.22344436961356207, 0.23412143013323206, 0.4497521036540385, 0.7783411140134132, 0.6651085015295487, 0.805500619039182, 0.42006930761624905, 0.7373953245465918, 0.370713441139768, 0.8174400238969727, 0.5466516119076666, 0.7335084704881211, 0.5202379166413224, 0.11542162253707544, 0.6505748650075571, 0.800396691080649, 0.598709404426928, 0.4076338533790068, 0.011093675729265784, 0.49151552615707395, 0.3939873609954073, 0.543529770245389, 0.23884188804790663, 0.5918511783929794, 0.9298321106933343, 0.4872741166023181, 0.1752169376975936, 0.9586235678581214, 0.07008939584828522, 0.8540969268847964, 0.4957453840155419, 0.29307877613742606], [0.06668423150386571, 0.576752712385868, 0.6553320336539173, 0.7218154672931968, 0.5048300591441031, 0.8200129661778313, 0.6309748421095772, 0.7397959119072075, 0.978068428356697, 0.30744121214261466, 0.8215711568705045, 0.13005230124078349, 0.47031335422531195, 0.22204636649296627, 0.6343627892221636, 0.7965419672617065, 0.9541765868240879, 0.9140868115099774, 0.2002782588384241, 0.8133521636541519, 0.438112165007861, 0.2571121899719917, 0.36893601250905983, 0.24724768614723613, 0.16986549742740076, 0.419252068107666, 0.6407836689949221, 0.6883249990179044, 0.3966436187821848, 0.2565848603750496, 0.04439520702621147, 0.3431574569518603], [0.22665261451382412, 0.058418029079569056, 0.9662965532618041, 0.674732219776758, 0.9630101618484582, 0.8804006972398454, 0.2647351329718194, 0.5551617584232605, 0.7849956986991099, 0.9671927590694487, 0.049064172244056015, 0.6544987445209026, 0.1995619858270984, 0.06160668365856892, 0.4491883087398276, 0.5745055183417042, 0.6098359242082027, 0.6787600135700654, 0.4886810746314131, 0.48151877385033026, 0.761558354703579, 0.5485197005470058, 0.9980324871407535, 0.6542303463136736, 0.9353195116606572, 0.651371976552219, 0.5775599614217342, 0.3856578469175389, 0.7755022472033892, 0.15016360554345987, 0.7197804082973526, 0.4610214963368433], [0.4285315635149701, 0.510980876865905, 0.8256856893023121, 0.4575582167646388, 0.8323162692845029, 0.07090772083494701, 0.6266852987896905, 0.4637469671345764, 0.2883315671083858, 0.2871132749745111, 0.6305852638191511, 0.9734288552286445, 0.12454146033734903, 0.9116616491877567, 0.39106733859842335, 0.6292107644785823, 0.7381173535136185, 0.8133823833379318, 0.966002929312541, 0.30122641199598377, 0.5128230841912782, 0.8201608175973756, 0.8038525926816205, 0.9995794594446382, 0.05714303843868784, 0.15723612531835396, 0.4405242715022377, 0.7273477652662586, 0.5322288450221954, 0.27187863961662506, 0.36620710681214685, 0.8645963829486345], [0.03666383001580964, 0.7127546917527653, 0.1508176327574018, 0.4382387181749674, 0.9718595004746302, 0.23020657908022923, 0.8255049335996475, 0.9857589659418927, 0.11772912145679115, 0.6607131897988638, 0.783858797191656, 0.5172894269257087, 0.7405524647728334, 0.1538329057322778, 0.8615628706516653, 0.7270003383778844, 0.7375318838569447, 0.617754679857757, 0.7441137639725541, 0.32838675673126216, 0.7791184266747991, 0.5991878854846037, 0.02104119586262687, 0.9178877709504103, 0.6889697427340669, 0.9342098494140935, 0.4490257438543319, 0.8986337248536825, 0.04626955297993529, 0.22648715649044926, 0.1396642624946116, 0.2819252074002655], [0.6810038010138448, 0.9737528848860414, 0.6433712022859119, 0.6788990198602357, 0.6637063024419319, 0.46880651087207237, 0.8660889429723354, 0.4088547771545845, 0.7333056835844728, 0.2100894234873243, 0.5063146632097149, 0.6231350378317325, 0.9073497878740769, 0.8704823882292662, 0.3534170070505277, 0.45541838634887766, 0.1853740201781756, 0.11075616145591294, 0.6167004022312983, 0.7228289654682355, 0.08948771539806433, 0.9861839620190864, 0.5756890208633455, 0.7520968637247238, 0.049703618400410265, 0.7653545832379783, 0.06087978253800708, 0.36420331819717433, 0.5792886069255315, 0.5953525075015303, 0.365831215441201, 0.6137139681230195], [0.4079311355024652, 0.013456633362067483, 0.4845801371498576, 0.32293085416549194, 0.8475991891440217, 0.9218878393642306, 0.7996573765886843, 0.49841643044325024, 0.3919779485562611, 0.9460006759516164, 0.08404764016513266, 0.5364255377298895, 0.8363410848881224, 0.8479594996083578, 0.44328032746164114, 0.40350855285701237, 0.9640761182905457, 0.2498847998077467, 0.7759315223755949, 0.21757122907548776, 0.9636550638433622, 0.06953181973173794, 0.6257453593286151, 0.8945653375607728, 0.5252765946572721, 0.36616835994452335, 0.4555805092533467, 0.7240232110017768, 0.21894093301512518, 0.1816072883276283, 0.9814505557698342, 0.51798228894286], [0.8436246724822664, 0.6848581892300823, 0.8495583167738423, 0.9901394785942862, 0.09057642208358474, 0.04340213512859925, 0.5444773474098168, 0.05973260053333751, 0.0872945546285323, 0.4883250843597188, 0.8879474803256117, 0.03942877456292049, 0.06496192493705821, 0.5188051994198792, 0.6966032793921819, 0.1584111672282038, 0.7024941311918993, 0.6148269479731058, 0.48485524048547224, 0.404664632780773, 0.3849910580416178, 0.8511616312969644, 0.31728922035000606, 0.19653772161711403, 0.36059695705472117, 0.19982646284532035, 0.7684689196450761, 0.4818358543129536, 0.9875390035083165, 0.9909032634332566, 0.8872188969964971, 0.8347642079791037]] )
43
+ b = tf.random_uniform(SHAPES)
44
44
 
45
- c = tf.constant([[0.6268575504635905, 0.5512190857405918, 0.866156991421617, 0.8102919275239063, 0.0041768509300789125, 0.5294601231699045, 0.08820549952517764, 0.28665896093880905, 0.6589096526496746, 0.5876273160107195, 0.46165668647491254, 0.427478607472916, 0.5509843143526969, 0.7245950130153438, 0.04545072567382935, 0.6066922671431771, 0.7625095452101046, 0.9345849989587532, 0.11276257844799564, 0.46333955772245383, 0.38081858499735943, 0.7507580267133078, 0.4511873802821186, 0.3310283702604825, 0.7322609307702771, 0.5879925547333457, 0.5466158458475555, 0.027146319879291725, 0.06582948575695535, 0.6182653803120038, 0.8149848301289084, 0.3326226229529389], [0.5975291790778268, 0.395838331424497, 0.5487031054543934, 0.5438426305265885, 0.8591635618227039, 0.3189483246446565, 0.12549988121165856, 0.8763408362294923, 0.9011232831008674, 0.4579588908583945, 0.4597964551981817, 0.0737734741399596, 0.7284476641480044, 0.8284040607078168, 0.7312841122241599, 0.7614846994910912, 0.04415248711081088, 0.6052069313583298, 0.3114354564143347, 0.2670759685722496, 0.596819393223937, 0.99208874132438, 0.6365524653451637, 0.12344781382381087, 0.028954456316550692, 0.4572354196801761, 0.10896772979440761, 0.873156572268005, 0.3998748368801094, 0.651406230374065, 0.7769815305697482, 0.6467942340532308], [0.83227811084482, 0.3962096303790622, 0.9901430278044254, 0.8204881112409526, 0.14413467841336025, 0.7718167318581433, 0.824095594463431, 0.957822159716171, 0.9617448625408758, 0.4679536422562858, 0.17387884367712603, 0.6131828487021125, 0.1799563162511173, 0.6131720296722407, 0.2006711114582329, 0.6979680580286014, 0.1493586093793018, 0.10528340635479239, 0.210661480806148, 0.7455236201726345, 0.19099554223430437, 0.6043228781499883, 0.48833236156653914, 0.5608477562057129, 0.5107730809393025, 0.5153544816436055, 0.290164333223189, 0.7556047801401093, 0.8070835399545606, 0.08724911208872055, 0.3491426285492767, 0.6500587173212595], [0.9248652718442084, 0.8814774090251546, 0.9553409797749535, 0.295005649112265, 0.3813741293972448, 0.515883516584407, 0.7625684655128887, 0.8139776359576618, 0.85647012057496, 0.5567039168078652, 0.9489056539724251, 0.45861368389008883, 0.6950369188180598, 0.029212387701210374, 0.33520160577764635, 0.7374632489975262, 0.497320074967757, 0.0283208924792675, 0.0013031564670215046, 0.3945721827351091, 0.01398476442865293, 0.9149725019169459, 0.8507985166462908, 0.11500503630246439, 0.1241221294067173, 0.7598724211022507, 0.6038859924747916, 0.8862257006312166, 0.8375077338098287, 0.9998096748477004, 0.014230744695875486, 0.6782894807167112], [0.790595688438302, 0.7253449180510096, 0.07855244752288992, 0.8824316476948456, 0.08860196011133492, 0.8026402625973867, 0.7348190086596686, 0.39357694582282, 0.5954870660313014, 0.7158619752005614, 0.37481466738704616, 0.28910251309521395, 0.06070215786104349, 0.9563140128777815, 0.6745937975785551, 0.29929870710192863, 0.5208165520892762, 0.4262180640769081, 0.07422975801806664, 0.3357334524883132, 0.7129558793534418, 0.5035434745671609, 0.3189769700931425, 0.5951479220516702, 0.20637625697466166, 0.4225318646440821, 0.5189323911036693, 0.57814737144478, 0.32822450157489114, 0.28955116901401046, 0.7000868228150426, 0.5422011919779888], [0.45587077814889543, 0.9576918083133615, 0.19692312922641675, 0.4505886454907845, 0.006449113727485578, 0.7650863344240302, 0.7345796687133562, 0.7780963403651603, 0.6842543636313344, 0.5290065667783171, 0.5198475543416338, 0.7839190647646768, 0.05071152397635281, 0.26749786520796937, 0.4524928820940002, 0.8199257391087201, 0.3107345643078757, 0.6440304329692421, 0.21972863701892797, 0.619692156592452, 0.9304301980585069, 0.6849097484325452, 0.5950946599720893, 0.10817550799743114, 0.6438379657522423, 0.6199176163316994, 0.9666190637134588, 0.197210531058288, 0.5848410301985143, 0.4400467325665609, 0.40251152972692783, 0.9769517694592457], [0.24288728671338777, 0.802286454434533, 0.37162228882231696, 0.8850777468205453, 0.5036240110843732, 0.7045343149556471, 0.7965430689787629, 0.5770929757328429, 0.041983869049309175, 0.7367819762458935, 0.5995293912729899, 0.4130073180970809, 0.31010149982267166, 0.8341274483356257, 0.18151613871276184, 0.8571563534905412, 0.5856831398015917, 0.2923057584738108, 0.9494195041431291, 0.9413552687533793, 0.9109961465347347, 0.7962672185152297, 0.20960410810719976, 0.7972385741654586, 0.20367879170997572, 0.31237647272462377, 0.5069160597874827, 0.2944264658254182, 0.02179463584201191, 0.7445748913783816, 0.018737294159438478, 0.1611676177899486], [0.46060198057105106, 0.9385195515345126, 0.8804595797248371, 0.4681552336788729, 0.2965403832908071, 0.14195797982162117, 0.5714570360804665, 0.1579992520556618, 0.4564493583928403, 0.7019902167776446, 0.8545638006755424, 0.46962112493002006, 0.9163132349725163, 0.21667250596255105, 0.07904482392585366, 0.6190166850191294, 0.18887648016604874, 0.2081170798116535, 0.9599463642583711, 0.13326655457788594, 0.39121632677693075, 0.6939307204972092, 0.8711426823664677, 0.4001724583479208, 0.11130083929793555, 0.06786751422156856, 0.9208427793391352, 0.6292199450456117, 0.591895199320512, 0.47701281163587217, 0.1849563651606022, 0.5085064897902769], [0.6770416080743922, 0.7627448738419118, 0.5092965708942974, 0.7424642608069618, 0.6505746287034156, 0.719303742531265, 0.9926703537524341, 0.22776228041829305, 0.6494009144579997, 0.7342294567986135, 0.6107884500943698, 0.6840204580080814, 0.28803367773708244, 0.3703894049710068, 0.7375263292102544, 0.1643810953349938, 0.8223542829059263, 0.11984043375144382, 0.5621629034976067, 0.036468372277688066, 0.5222593084433319, 0.881777929606344, 0.49189591885695716, 0.5937611194541174, 0.5199361086047869, 0.1567227518848041, 0.9602595253725992, 0.21696630609411416, 0.2595124568051863, 0.012698872487414858, 0.037988246947466275, 0.7333311858505561], [0.4112996700310866, 0.1349616998288543, 0.18009471088676865, 0.37273771138078937, 0.07794877350216378, 0.8443509463157373, 0.7633518947702138, 0.95995995706027, 0.5480968220887675, 0.19071481455730133, 0.25889883288296267, 0.711076979791164, 0.47901421162322166, 0.046375370999836685, 0.482504477826017, 0.09620349275421558, 0.5348609597111377, 0.2650547517113522, 0.7155205893961695, 0.9044745448294466, 0.8062625314180307, 0.594834126984524, 0.4309249312628828, 0.1251770584508518, 0.09526781406680651, 0.1277029978182238, 0.922713443599185, 0.15359324115372452, 0.9710170603389223, 0.23227467078812725, 0.28237247945457655, 0.8490764493857825], [0.20422047013123745, 0.33252707261076997, 0.8365765109145139, 0.010689203587491258, 0.1484719003521544, 0.9736164627495916, 0.7015923236416972, 0.35326290121612614, 0.7506929824864897, 0.05435123076597037, 0.6835940956640675, 0.6547647159911468, 0.5237377890475952, 0.3287441294860258, 0.6180816323939371, 0.023203967035237305, 0.20482792018076168, 0.1478012355553665, 0.5029062525207699, 0.32553673902969105, 0.6649371954920599, 0.022574797883370135, 0.7103215473419847, 0.7514491270585264, 0.8791516557004659, 0.9330534372928266, 0.40377533142206656, 0.0006192619813992772, 0.5036622730753638, 0.32922622018010106, 0.95267980819912, 0.6193336442152841], [0.3477301840634174, 0.9023027130837264, 0.06934463698746574, 0.772528573017708, 0.7016754538776953, 0.5749954694442788, 0.08652732892679982, 0.7261503201900321, 0.946678769594144, 0.3794382044129835, 0.933910709731179, 0.6573540067963177, 0.7342756052464141, 0.3911617152934007, 0.8597335018354195, 0.2228995552485038, 0.8011574846281257, 0.358687943781838, 0.3754365714816097, 0.4682242308926855, 0.3064294673861595, 0.8406860150263742, 0.7618808445219842, 0.2284385315846822, 0.41106645195363334, 0.014144917943072377, 0.6153893135480626, 0.16046215286111087, 0.4028615524722141, 0.20125488970293182, 0.32064756198519084, 0.11156757316430022], [0.609685897920959, 0.43265781798718006, 0.3087067638832577, 0.7634731033113045, 0.5635471409453202, 0.28811964613263996, 0.643035735910315, 0.2571569403922054, 0.3156341720143194, 0.7868264514040348, 0.7128842438926087, 0.1797956234916518, 0.9228322158606036, 0.7909581794480155, 0.34258064075775974, 0.40897739075163453, 0.6303876711512121, 0.8161549656786645, 0.42258983799065597, 0.6920501764355502, 0.48527593576015404, 0.17648548772029515, 0.8305777488581696, 0.8693302449217646, 0.27460747113828066, 0.7073110224879127, 0.4702452571287383, 0.22307131854145013, 0.43040233748475654, 0.18771095405280036, 0.3501969314214688, 0.5261100686968261], [0.1430407285133659, 0.002604491978504875, 0.5520354653533467, 0.9590448256139258, 0.2672314478181629, 0.44801422790068157, 0.002902944745233671, 0.689629608025406, 0.8602180554491603, 0.5147158597185761, 0.8108010581260112, 0.46825296174064135, 0.372265794033937, 0.7082109538468726, 0.6908852038820316, 0.8842188134054157, 0.8143862339779993, 0.6004821379340973, 0.8861882119033166, 0.12818957460809988, 0.8243580294263368, 0.5735364107122427, 0.09328183380785093, 0.5036569113071455, 0.3145348653380715, 0.8740385733155657, 0.8987891272482303, 0.4794772019090334, 0.05638746193315691, 0.28363712812493136, 0.5725072015430784, 0.045377803832025165], [0.22739605856287037, 0.779797032189448, 0.17870554899942592, 0.11291981049039423, 0.22123348462556558, 0.3496606414558575, 0.45238964661254977, 0.46260902443765894, 0.8563089745161843, 0.5525396732092104, 0.6509940949093097, 0.33285386451807497, 0.6435251168645874, 0.1685530484470028, 0.35459616336614785, 0.918922921709699, 0.38889457452963194, 0.4696893407418433, 0.29043096818007874, 0.07934010432439975, 0.2128878897583959, 0.9231474783042389, 0.6044388525302804, 0.8620334530051079, 0.2966024187376105, 0.07154384872640074, 0.9429834791553229, 0.08501834483107606, 0.1812817094065603, 0.21606526473065713, 0.6823902663471464, 0.6796353272139972], [0.9441207764663538, 0.4245157069968316, 0.8222744409334722, 0.46158457020549026, 0.011765681208412926, 0.09554326996267826, 0.701273314661676, 0.27025088432858957, 0.2857064747259277, 0.35470433687995784, 0.4407871972479115, 0.11870928414532356, 0.7147033323095116, 0.4961131549768315, 0.7394284588823111, 0.10552921193323106, 0.5671900096630247, 0.20791853545619998, 0.4206670420877663, 0.7580168258818099, 0.9369914737693451, 0.5248905244218802, 0.8916455261057642, 0.9394969444219277, 0.7888867220486254, 0.5489925955283625, 0.32635901932129907, 0.7821496888159738, 0.5717651682835382, 0.594334126659058, 0.7739528432689733, 0.32779637673481354], [0.2601861439648242, 0.8979903955542252, 0.29586471696167915, 0.9521953764606982, 0.0054737315655553065, 0.7639670617373903, 0.747407946039646, 0.10662750474777061, 0.7396872108309697, 0.4619429177154306, 0.14441591664068687, 0.7721634203987974, 0.6141181273955777, 0.3222068383285297, 0.9396239681907185, 0.254229050642673, 0.31023490719790614, 0.3466460787369856, 0.6146391637755089, 0.19059618853667282, 0.31588170328314535, 0.08179083578016344, 0.8585602423675563, 0.07502544187234239, 0.39029018678019844, 0.8345677702096178, 0.6115610057035962, 0.5739516959615045, 0.7927386532561287, 0.509196455738511, 0.8196428209321956, 0.4113526139645065], [0.25872011250912974, 0.7559780976670561, 0.9589901605199695, 0.06910504271268647, 0.3929209846282933, 0.4124482000720149, 0.5941054408991692, 0.23943432531530107, 0.3871185646671452, 0.14184121424353835, 0.08382720538505462, 0.1806956192829361, 0.5664544071196284, 0.014009153628147586, 0.6984269465254571, 0.09608915553378128, 0.3390385250806651, 0.43137803708277, 0.3346335846263463, 0.26177156546081615, 0.3668152342172848, 0.17963298436484465, 0.27908227981167244, 0.7471488544782123, 0.016021657044276383, 0.8284313646229962, 0.9695185009335052, 0.3854151158526168, 0.5176244777170271, 0.2430852852794182, 0.11044777077424761, 0.08385388618438316], [0.4086082453050536, 0.4251112926347326, 0.576179501406181, 0.39624095152063776, 0.9597098373759916, 0.3814864104374266, 0.6414647909212415, 0.7633674810117431, 0.9928949164201816, 0.46728473176374297, 0.6822537115713174, 0.7615899155225819, 0.21930564420984322, 0.9325704354312905, 0.7306891264246875, 0.8438351730589957, 0.4193958606718664, 0.7220097823285594, 0.4527540307806053, 0.4904312977650752, 0.16278006137931778, 0.9701970493738994, 0.3043371653287844, 0.551091101632813, 0.46850960251549834, 0.10854392963727655, 0.3033375588119098, 0.9011192919289412, 0.23349816426058667, 0.22801467702381573, 0.05875166173865776, 0.6123237489615029], [0.295290575820649, 0.692883669960145, 0.13819068009772628, 0.9394721884757884, 0.377924666388193, 0.5403964545056966, 0.25485663482046017, 0.7814953492463816, 0.11685519525322285, 0.4535697299248401, 0.3640143956058347, 0.15402013994018893, 0.9093561678585519, 0.43284768738306156, 0.46345239605358035, 0.03371310170502273, 0.21538400332121022, 0.9445940957968413, 0.9696742379010392, 0.08422239421368372, 0.38099434806916654, 0.8564760829685132, 0.7554011653494254, 0.8753772034963813, 0.08775732972518979, 0.44669429161792096, 0.7062261196798587, 0.6377693845662084, 0.7314312239377048, 0.4839830263029392, 0.6628545384177382, 0.3162641278565059], [0.9588778311592273, 0.18787397691559682, 0.90880032305718, 0.9443760482536926, 0.64416374016405, 0.5911621918603347, 0.6397736920574366, 0.9588775468819039, 0.292615923937914, 0.28419353863953545, 0.5418323992965793, 0.8927430726564759, 0.2210830355122253, 0.7160390452917823, 0.4977951633122909, 0.3216045144814329, 0.05046124265598029, 0.8072767857279881, 0.39695385036553366, 0.475821560067773, 0.12493882828345582, 0.46557558204553284, 0.6999177888014708, 0.9863622273250217, 0.6142181530297851, 0.15967644042791707, 0.632836854088624, 0.2058441542454601, 0.4771236867688745, 0.12045891088124627, 0.8893406301842138, 0.6474020610110207], [0.12344527135018857, 0.7124418004801426, 0.3340290091377849, 0.866471906358675, 0.09027146393731977, 0.7181563016945036, 0.34541055284241473, 0.0528286840135489, 0.8779518985244091, 0.560027014266635, 0.7860983171605241, 0.27630141668970787, 0.3682091987928665, 0.8823979433540122, 0.46312145956452744, 0.10463699901621215, 0.5360306353064723, 0.8103658472920565, 0.9057998168890483, 0.9146099208390346, 0.2546340346879462, 0.14511499168986575, 0.9767604111414999, 0.3164275930944762, 0.835355664923142, 0.8473069687825376, 0.16607105220444285, 0.9609818547312925, 0.912200735996038, 0.41039886859138075, 0.19823579217201748, 0.6206024198623865], [0.9126167679630289, 0.3068386351604827, 0.5262894917442872, 0.442417220899989, 0.5406810073566387, 0.731557162458844, 0.8026079238810221, 0.3204701111781578, 0.6137335895188626, 0.7391195098749671, 0.18802975375001718, 0.49083069480402985, 0.593681181291366, 0.005632590689789829, 0.4926183362898686, 0.16635975687125326, 0.815942230158507, 0.8743355493295167, 0.8545428802348363, 0.8253427359159706, 0.2600607341485427, 0.9005718216771358, 0.2637672345419626, 0.1745868997743777, 0.16663010802271194, 0.15379417956463348, 0.4224438968810055, 0.3763082816333607, 0.33778274699077526, 0.9039611838315827, 0.19430635415721464, 0.6033460378875115], [0.31016030954093776, 0.9877515799518617, 0.8652752946091672, 0.4052720509697657, 0.06056038725929358, 0.5803079754125479, 0.8942640901982494, 0.9821816425200537, 0.4893388974650038, 0.6059217674455107, 0.25405915050021566, 0.4065245878895938, 0.3013774077865592, 0.9632068175382758, 0.2714460161106864, 0.6121232676296308, 0.4571798162189489, 0.5767547388709806, 0.8563537600513401, 0.535382747586048, 0.8099978707283297, 0.69367041629764, 0.7109343356876275, 0.8447990882679571, 0.8093662331591984, 0.21269718147641004, 0.826091878886847, 0.5268926994441784, 0.7727051279001322, 0.03657526917573273, 0.6364341536333961, 0.1988910031855301], [0.30453459552996975, 0.3816570791199667, 0.5612093008116574, 0.5463491928716422, 0.2470313719182229, 0.8433227196907993, 0.8659594014746241, 0.5331274295585593, 0.11007504020680003, 0.6858291500569509, 0.48986196447287766, 0.8492616895567796, 0.7883508543866401, 0.35735008279837066, 0.22856737322769272, 0.575109393154646, 0.2900360789247577, 0.8381903085321383, 0.09439420110384222, 0.4492378640160998, 0.8290536693215053, 0.2980733687751438, 0.8263452481090707, 0.5182834101749274, 0.26379098873413376, 0.9672309258351862, 0.6516801686067956, 0.5504916088779883, 0.4970942819636254, 0.08296269809079826, 0.18245549732606703, 0.5874787119977832], [0.35412747393061283, 0.5724282115074575, 0.5552299171917929, 0.8604793547082874, 0.7228888419679769, 0.7230982521642324, 0.1459276891981176, 0.1816793906435915, 0.102370723479697, 0.13338729112412107, 0.19416735528925455, 0.6522157993884186, 0.003968178182909954, 0.804679895123938, 0.4551673799051187, 0.4772995340017293, 0.9813209887400528, 0.5591335199568687, 0.8429126667592084, 0.703259426933208, 0.08472450932041098, 0.769059995201089, 0.8939671939284237, 0.8332833733701183, 0.9995482916919615, 0.917530834523003, 0.09769834537612454, 0.22316506047676044, 0.6888539648358122, 0.039934924260001226, 0.43695257825879286, 0.9801238226786705], [0.5109135521599009, 0.4774895910962379, 0.9897086643654012, 0.023726820362560797, 0.9924665669650736, 0.19139257406060228, 0.3636086252203049, 0.9226967372664402, 0.5345806994594909, 0.8997759052360474, 0.07045035698265545, 0.6842095637705186, 0.7021646221200941, 0.09695387683271794, 0.638072681845106, 0.440558613571836, 0.13057928096724503, 0.6017813675415264, 0.4048761842778069, 0.3307135675067209, 0.3912133964229886, 0.027975724202964014, 0.8447472290893533, 0.4485843522369677, 0.42419537876184465, 0.010970252625689958, 0.16061081697728385, 0.5476269278683946, 0.2885616164546636, 0.5951029642143374, 0.1702468039759769, 0.49819526174325013], [0.12197906043255757, 0.19462882304678097, 0.7531045317786015, 0.6195143303510532, 0.18357895864359353, 0.8062043295698617, 0.4233623353202357, 0.009896847269700082, 0.834936040928834, 0.9860103582025249, 0.7387243353819254, 0.9800722185937756, 0.6320485926717369, 0.49389135359083347, 0.014243059121939461, 0.5707390607753948, 0.01573073711923456, 0.9219767971078765, 0.21539967075225563, 0.8461566411955582, 0.8806057571203548, 0.5990352412205893, 0.6688837959942534, 0.13707962409293872, 0.05828700736243231, 0.47311516377161333, 0.31849485738190975, 0.6539399697457537, 0.8903976390503325, 0.5121945619325756, 0.9444539222864471, 0.9273616401454633], [0.049130293198896946, 0.5630552904157171, 0.3753919793172805, 0.5298968320911149, 0.2897399527330188, 0.03294431851400592, 0.7230406438180017, 0.3078455536685196, 0.8942056742795451, 0.8336763066609894, 0.23237133588147396, 0.10982968161631523, 0.04873033918498493, 0.8656520559151498, 0.10300504298215507, 0.03443940112903254, 0.5943182031961881, 0.4544887066067542, 0.5962708326722237, 0.9565864225613127, 0.3991290359362668, 0.9419080729097457, 0.23920258713366682, 0.921826986088243, 0.756676024427886, 0.08786510100210543, 0.61836260281556, 0.8118732408522349, 0.4384192847038497, 0.20530912007929858, 0.8460774695189027, 0.25268894364414163], [0.05136907830219606, 0.5325989781189641, 0.5716316288851719, 0.5966846190099043, 0.03379255544431092, 0.3887563371836821, 0.35270121958683887, 0.3231844426489373, 0.9483925420961679, 0.5116936866986809, 0.5676326371270395, 0.8396078606805014, 0.3294502522099265, 0.14748414073204008, 0.7998726314930951, 0.7706541204429952, 0.19811973975415054, 0.5609810998493968, 0.5437514620271441, 0.08538322132149212, 0.45505507028228853, 0.37550858213395844, 0.012402505141148823, 0.9082321349747439, 0.028843862951853705, 0.4249037902072249, 0.18076852070944627, 0.8712705587709374, 0.5154130616438725, 0.5416341347601763, 0.012082123987700033, 0.5375814806478778], [0.41957460217499776, 0.18721797424106823, 0.4668738265823963, 0.2778996478500566, 0.4355338734552977, 0.5666132507392513, 0.07664550705612039, 0.8976370416537364, 0.9657282828780405, 0.8884673095294807, 0.3947195476567721, 0.820173659320159, 0.5979943904061499, 0.9579898541980665, 0.3278242179983506, 0.18520325019805395, 0.9335774110816378, 0.07022936092469179, 0.5521101469634904, 0.7158133804580757, 0.48533071051114796, 0.4167635970523389, 0.6354433705254438, 0.8919902175024745, 0.312448587592255, 0.030499891137592217, 0.8539293625732337, 0.8276201651778115, 0.16191937707863047, 0.60451657581339, 0.7482384806786624, 0.41903705058802587], [0.32569306778597495, 0.8210974430157161, 0.20262027602404753, 0.6126037075746449, 0.27873736029845964, 0.7818315124091394, 0.7320041993120122, 0.641391087549912, 0.4468803589107744, 0.5455826342581707, 0.01937351527331066, 0.011464422961352971, 0.7994913291361598, 0.4060197541659343, 0.6081166824882004, 0.3834106303498974, 0.6967549427812244, 0.9394428525668608, 0.7466189448677549, 0.9266063744010281, 0.7551677680241168, 0.34038264799281137, 0.24985888890600383, 0.16865786024978113, 0.48890849393636826, 0.3339810683890474, 0.1724359780090966, 0.7079332622660605, 0.9909019267193419, 0.9136979467244604, 0.3351646625647542, 0.10881211498414955]]
46
- )
45
+ c = tf.random_uniform(SHAPES)
47
46
 
48
- d = tf.constant([[0.39144937117944334, 0.4082101825868204, 0.9727200859726586, 0.6156516143793533, 0.23720313606562604, 0.8000672205945346, 0.00461365579299422, 0.7017026889985426, 0.3552597871219384, 0.7929075277522788, 0.7626603526071536, 0.1469633983557368, 0.7952898501192047, 0.813432446561336, 0.46655702419556233, 0.72560664648807, 0.9309297495110093, 0.33199579699130355, 0.34726405777933356, 0.3536916503387605, 0.4626144105929487, 0.013578717839856203, 0.8192751680206227, 0.7496324649442807, 0.16258117089325086, 0.6444459718447129, 0.4518883299896367, 0.8299089424243237, 0.5502113272644855, 0.1894053265183122, 0.3319703044619988, 0.8212385212134794], [0.9955062590550128, 0.5635795006803149, 0.6751706727211689, 0.9054575128934611, 0.038413234786809025, 0.49926249991909954, 0.7374676907835236, 0.42234481885501496, 0.1879866658792977, 0.09900619783854636, 0.11365739012714526, 0.004033980021428518, 0.6239950980160731, 0.4569517343341881, 0.25243782830153016, 0.09088071892753635, 0.9564497816699978, 0.9836022201609906, 0.4519398854527471, 0.2845834574497731, 0.6680230649257562, 0.37728253835356806, 0.31288095803161475, 0.804160416309114, 0.028515276976282422, 0.28966812430616085, 0.24137480322906513, 0.45209713900775117, 0.3836889985260623, 0.7385118646314575, 0.6318175252217707, 0.03031549084516605], [0.43007804618245504, 0.17969850851330615, 0.7864720392096028, 0.8038043900040045, 0.390583289350766, 0.18292329496269066, 0.9156514916038422, 0.8528944528620194, 0.20014578696251006, 0.1754566427873061, 0.9542146820692758, 0.6263319611575888, 0.4431151305214641, 0.057466792393885746, 0.6965601558569826, 0.3336988179571603, 0.22191903075109853, 0.2023773027268868, 0.5189362980553621, 0.12551772485547985, 0.5910783277945088, 0.8335738906761291, 0.7388749961005011, 0.8427265499287423, 0.26096018584681513, 0.3297581752531762, 0.9186413598510438, 0.5677928661132785, 0.0943322646567728, 0.7147243950032962, 0.48136714338022113, 0.9924389181801101], [0.1250929807754919, 0.7748840718205273, 0.6917984584880004, 0.44442891593420963, 0.4150681923564088, 0.6907382027891452, 0.40353146877068335, 0.9644143373615058, 0.4415944192287473, 0.4034214158769658, 0.8423353254399497, 0.6518726510767163, 0.9433239948883027, 0.26943497143631756, 0.4908283112586418, 0.08798994584388797, 0.055843236792346596, 0.023016982906404526, 0.9157723493425155, 0.09445754328449207, 0.48555660977364756, 0.8177595837649378, 0.24289350229365603, 0.455745714038688, 0.5304158097212315, 0.1178994721925285, 0.242680195825976, 0.17575814326883055, 0.9861934197984971, 0.6264302257279959, 0.2325825566848595, 0.4276819664620689], [0.40573144529503447, 0.013876091009031088, 0.701985183691929, 0.10228301458119582, 0.11348945440671021, 0.8244864159628571, 0.7776096873364814, 0.15938161361371084, 0.7830047733998073, 0.15148029463662627, 0.2694717580145827, 0.7429907566762431, 0.34908613717994497, 0.8842186375304253, 0.5435770882872577, 0.07301279259644367, 0.657930189827015, 0.43718900166761754, 0.22245621798516046, 0.2551877188341367, 0.3745456045871558, 0.843611835861996, 0.4257477921150823, 0.7334135518408427, 0.06160223492939254, 0.5551009023977219, 0.606849389859561, 0.8342483816921958, 0.9522470670491667, 0.870306311869842, 0.12947269869193223, 0.6654714577507548], [0.5037462619869353, 0.6016542258406877, 0.7199222478761103, 0.5671687390160814, 0.943522022310889, 0.4383138924919089, 0.723479014174237, 0.7899681140029118, 0.9266200562151241, 0.1850774969414236, 0.18354243618202692, 0.5091662262598938, 0.20227739197407113, 0.24855645000525417, 0.707375266752125, 0.4271759796064386, 0.5546543548268422, 0.9490672154149374, 0.08830432073282257, 0.15046006520581112, 0.08831284740566747, 0.34655947869613535, 0.8500713279429531, 0.3562457365656143, 0.3496910762711608, 0.9189029628919657, 0.8242133920736484, 0.40445514233011937, 0.5224632656798024, 0.9896420182219804, 0.3277113485479205, 0.16023940902380984], [0.43604694370059327, 0.23543631037635282, 0.5194999139511116, 0.070506512518272, 0.6085298181020116, 0.11762909426434409, 0.6338198236679661, 0.6142741010811198, 0.8947760483174164, 0.6288471933159895, 0.9141601737886387, 0.6003063697138115, 0.5626220843084387, 0.34033392975922905, 0.36390895364989717, 0.7394644861753817, 0.2132549211643795, 0.7290387363273507, 0.7897343296587082, 0.1329305943874891, 0.65593944163524, 0.4555452673824173, 0.8194092493934999, 0.9848213928601763, 0.09753265078896978, 0.6136078697289198, 0.39312319054418643, 0.36655937915697245, 0.641122050596032, 0.036446787909795386, 0.7999134442594481, 0.34288182984296367], [0.8310243613504701, 0.8923354005312714, 0.6039926654280601, 0.8402155692655189, 0.0804829232332902, 0.30706579768056763, 0.5130427178281298, 0.03705378063426934, 0.2735114947150199, 0.957822007580278, 0.6188373294457666, 0.38141760935943503, 0.5076258251075831, 0.8042890324491061, 0.7260562296592189, 0.2521681373686564, 0.4748345213890708, 0.7430129348343513, 0.06157668997269383, 0.47554658807689687, 0.34244352388824684, 0.811516527410415, 0.8325531710073419, 0.29574274414304336, 0.9855771044377903, 0.7166335436190635, 0.6115360125804307, 0.026501068282112406, 0.7623263658641223, 0.2972856696960787, 0.2356945392240507, 0.39826319608794547], [0.24446749676443347, 0.0312372404964526, 0.5461690413623118, 0.16522070782642184, 0.10232645271393892, 0.6963796676481303, 0.10878642137986061, 0.01233615864350568, 0.7176264579295161, 0.23651269521611185, 0.18702803663853007, 0.2988605657066118, 0.2330835367638462, 0.7296068683925131, 0.09834254298930967, 0.32915491893280313, 0.8588197478827195, 0.007760508300620028, 0.6137747213827291, 0.500023987105074, 0.9749210716988655, 0.42856738616266166, 0.4433984570714862, 0.7195414255250754, 0.018561725853294853, 0.6436151214922795, 0.5687508554448868, 0.10880453614471852, 0.25267578515957967, 0.5636323887080811, 0.7894134362084916, 0.3598415914434788], [0.7699378477808226, 0.9786847237263994, 0.09139036665279288, 0.4728748349513907, 0.9692777673686953, 0.039201848742667744, 0.4346294261976452, 0.9196509000619537, 0.3964023206189883, 0.44472589464021717, 0.7126961655627748, 0.3691773810892882, 0.07435971136917774, 0.08405698396739125, 0.04563599064332813, 0.28615822335294583, 0.016078893566004115, 0.7386311172400519, 0.9859153565909056, 0.40681547776752713, 0.5569711185464101, 0.84241021820214, 0.6418150324309408, 0.48328741905205064, 0.4388491698046981, 0.13580278518874478, 0.6487095456608187, 0.9258785806673118, 0.046785478523670876, 0.4259727429557576, 0.4129053745132486, 0.8101289097661708], [0.4753959762037331, 0.14877116018938852, 0.16257664707658992, 0.23434602125035864, 0.5777611508728356, 0.22876956045529995, 0.13068792403483098, 0.9179473891930016, 0.39583926500354016, 0.7633895200377732, 0.020381459944937896, 0.6440192713381131, 0.5321502597909696, 0.178828187395499, 0.6604541173744986, 0.5131084632585231, 0.8388716481846142, 0.8805197763474246, 0.013656972925165989, 0.5660813945294706, 0.6985827662143712, 0.5529450363121363, 0.9194680151559513, 0.8868570068727575, 0.936841137350417, 0.28217109697340714, 0.5520270287011503, 0.5228439701977787, 0.8912237203838927, 0.8647781738854884, 0.6432380879001809, 0.9042280997190616], [0.5588836780793643, 0.3478205446520871, 0.7816452552250244, 0.8619453603420328, 0.8067006737998157, 0.018545755241825, 0.9439079008898981, 0.6824514874699221, 0.8832544945940547, 0.05062113458479223, 0.6010178391175346, 0.19075567121171022, 0.671838714568696, 0.21502056256805968, 0.05634523671918512, 0.09001876878316417, 0.914983131312433, 0.45345919792497746, 0.5887933504193577, 0.4184748879393536, 0.0012234360200017447, 0.3613526595978561, 0.18709776717259485, 0.9150970088187567, 0.9029409067815748, 0.4317443418438096, 0.15621408688550886, 0.08244921065289446, 0.38633564518308905, 0.9699888123019964, 0.27139960617514125, 0.648241608010174], [0.1727383806547531, 0.2795542348999126, 0.24225951763878661, 0.5297634484445263, 0.5023969959393211, 0.2690169159003091, 0.03481737929793227, 0.8746075557555952, 0.2932465875912984, 0.06441338502743144, 0.1535124989034401, 0.158206311753879, 0.25047728899951593, 0.7460863426537211, 0.05506973170448848, 0.2535855037286059, 0.6122420857253269, 0.4331236653180591, 0.09056827234597287, 0.7269500198827354, 0.9302762427580867, 0.8835651404181389, 0.1803086182113991, 0.309297790640518, 0.765590290505709, 0.8276395402723863, 0.029633282249287407, 0.9801451194348089, 0.6995252990379072, 0.25035958214921217, 0.9557770389170898, 0.2811033878756699], [0.9232665233253948, 0.5225885996925279, 0.6697732659022344, 0.8626039946369954, 0.716174918132681, 0.2071760731000274, 0.39919671525138556, 0.072234088806722, 0.2392233571345136, 0.651418969856912, 0.21481867082806938, 0.7335266299610513, 0.8375293666280536, 0.8476256789777709, 0.4645583132284946, 0.2574252041832711, 0.21909349674563083, 0.1785358077342062, 0.9170378254544254, 0.7925979413104476, 0.08139144182295655, 0.529684412631264, 0.9817176824487382, 0.7176441473768178, 0.9335245539629313, 0.5408463655467862, 0.011803253817015191, 0.23153205930005982, 0.6572497260620415, 0.6347289510800221, 0.8008776838068705, 0.22910329384367834], [0.5280080278376538, 0.44824067304083104, 0.6527249851247483, 0.6168761566240575, 0.8895526977698698, 0.7043710671802439, 0.5864882067269351, 0.6361483952253748, 0.22366289768634118, 0.016951713735155693, 0.3672366979481051, 0.9447789272061052, 0.24973698584037018, 0.8024083943126201, 0.35777179847070895, 0.2688918617257702, 0.31569038760028456, 0.8887657648967199, 0.15874208571844006, 0.6833692399570885, 0.9675815675597929, 0.4514323601997816, 0.767068157195736, 0.5449515251249593, 0.4635947747867817, 0.8445454233305147, 0.16536280937855208, 0.5027325101280891, 0.8699787353373056, 0.8708482711729046, 0.8384970692895395, 0.9013708243992917], [0.42623353023462374, 0.15200126012540982, 0.37482883068944084, 0.5372796353018784, 0.4813118728443757, 0.4518720826921996, 0.1857177970557492, 0.43565090602586576, 0.637101076019419, 0.18803500155560993, 0.8290355731744996, 0.44051273819859527, 0.8671511419330513, 0.24553123352062012, 0.6384604471208198, 0.2333050008405727, 0.6074063133722996, 0.07217912545792238, 0.2772561551220105, 0.7931291676346409, 0.23644597087762786, 0.4595880545424994, 0.8473046449826694, 0.6325434657874548, 0.701251797781596, 0.7301590266954011, 0.9512866502870932, 0.23769789061453994, 0.01851851577499064, 0.8543050913248926, 0.24297113667286974, 0.3213950303714638], [0.23628177584263876, 0.05658415354867685, 0.9172410879223957, 0.18216579460958893, 0.8561710391678284, 0.8869730343995785, 0.05793007539993933, 0.8994706763583721, 0.5057909483236714, 0.7687523556969518, 0.7747591868074237, 0.8312466289793364, 0.89350492468684, 0.34748742614178296, 0.217746679543526, 0.38928006939956217, 0.5213486250076013, 0.876045071658904, 0.3778438734861097, 0.7433215420126994, 0.16679035341558968, 0.10475224486505152, 0.28051264687174293, 0.45352496782742835, 0.4932997665646134, 0.1863339605773029, 0.9500376147090065, 0.9561987783474518, 0.15929859030469984, 0.548449296119296, 0.36310786945458273, 0.7976864065325301], [0.44137444061063347, 0.1841823577379127, 0.6350211396923422, 0.8893165277870345, 0.6729303850405485, 0.6755274351315124, 0.4179597847570191, 0.805983506484505, 0.21593999191247015, 0.026702082145585226, 0.8988615955200621, 0.2660114193292753, 0.2549530876655165, 0.6707317745706259, 0.47142094334504014, 0.5609212097040077, 0.7861776251835646, 0.6138142544361429, 0.3949160817529701, 0.7615155151381876, 0.3370372877300334, 0.2756828746669072, 0.8083417672653735, 0.5019171118607881, 0.27985257447779044, 0.7924376294832344, 0.5939136352027863, 0.4044429018783622, 0.7721817603720379, 0.16812770227850282, 0.4414692594437395, 0.2746158737559987], [0.858622617437101, 0.011409367177584784, 0.7774295128554511, 0.49607050342953807, 0.3631668796903843, 0.28171755253570796, 0.01529000574902395, 0.0462145683034797, 0.7962013531694936, 0.03590201841563612, 0.7528041814326657, 0.5425634450441991, 0.39393427533642833, 0.5295955121829573, 0.6234816975828925, 0.6595604552139901, 0.674032427893058, 0.7826561245547099, 0.4004338792365668, 0.8491970016081424, 0.49887797724590377, 0.5250139427394652, 0.6648648846680703, 0.9081383185561351, 0.8879211613816592, 0.7693641824074956, 0.4767248819677613, 0.2806225798005926, 0.9942637352448305, 0.2263159280115874, 0.5968488603893715, 0.6940378417551168], [0.09906752454492429, 0.6013664662196292, 0.1977518778873254, 0.2517164645448884, 0.04885058291126121, 0.709080515907799, 0.4657353419138105, 0.6716982305609714, 0.1601459140361181, 0.45044731117741654, 0.37813044655800354, 0.5213522043776574, 0.7099422184958581, 0.29688929093327465, 0.8804506370041302, 0.6116176723478504, 0.8154007646316187, 0.9688866920105871, 0.14657189772879498, 0.5596448102611936, 0.9811790633357728, 0.15848428951311078, 0.6380020106308608, 0.4162274812496829, 0.8581264528547475, 0.20829069482698048, 0.5876237986930916, 0.33880353187080203, 0.6520223458314826, 0.9188104772431881, 0.7789587315843632, 0.33405623261380035], [0.619213726518213, 0.7278448298268938, 0.924510224547253, 0.4475273970137482, 0.6559403503073675, 0.9483385042198736, 0.121106913958002, 0.21007448388969419, 0.015117346638368834, 0.44973970795844465, 0.5430556631208379, 0.13241724325847104, 0.45688612729760536, 0.9398144215088762, 0.8284548734568431, 0.4670516616249999, 0.4144420730562709, 0.7262039531419263, 0.14979174063140865, 0.1849568350346893, 0.3343907520282683, 0.5695268552690231, 0.3218647530511095, 0.2234377741142839, 0.45781388168407977, 0.9459221127251146, 0.5169879847264751, 0.06145182599297572, 0.9171344115903451, 0.6565330267511987, 0.585235081149576, 0.6334868827377669], [0.3568068355005478, 0.5000614822988557, 0.6630998168774105, 0.0013558262490127593, 0.14066364299377876, 0.8056765219272215, 0.8152252666622102, 0.828595252786045, 0.7137147013554425, 0.7964420348148665, 0.2530065412796849, 0.6062175350171901, 0.4581594366197501, 0.7268703541485235, 0.15519111247517525, 0.8110240263356171, 0.4911907624953006, 0.28707105474274375, 0.5262814332160917, 0.7672602180394097, 0.6970817116504459, 0.2662446024084696, 0.12236739091814985, 0.5438087699526762, 0.6166934241109767, 0.9759649477148125, 0.24506108636904422, 0.28718975424469706, 0.11669167923448276, 0.3300067804876763, 0.5246669062307036, 0.7305609880193934], [0.6869709434438256, 0.4709720043242063, 0.859579066005222, 0.851385845895961, 0.7444135518071844, 0.2428010100392517, 0.0480300613204695, 0.3165980011032461, 0.27164309011773435, 0.438109637062276, 0.7004444699115435, 0.28234846790472823, 0.9748216747297821, 0.2784915622517219, 0.3082385542577599, 0.837708804904935, 0.7386129779540481, 0.48952802566824416, 0.990289608475072, 0.4736938355750149, 0.3966149708499356, 0.15908416946380677, 0.003125922072427012, 0.843309303293517, 0.19970665537103116, 0.5947476497418114, 0.8410925802378117, 0.4580064397191217, 0.5312400524144205, 0.5852147820199656, 0.3538806347433072, 0.3472527384720976], [0.3975526794430635, 0.043614885687485505, 0.9690903095248774, 0.2329586359733854, 0.41531948372770455, 0.6711083600308897, 0.15191294727275617, 0.5344025909443644, 0.9992185482568001, 0.864333929738116, 0.3992016244980596, 0.9989290211960116, 0.013438917570127606, 0.14849955205583842, 0.9137607598194856, 0.6239493817522918, 0.3805119634324865, 0.16481302452865165, 0.1765421681099374, 0.46265553904285484, 0.10972412293163325, 0.44861131692180956, 0.19449468382099155, 0.4512422755912584, 0.4316681171100527, 0.6052749363517765, 0.9334166224900489, 0.6943121675129493, 0.8918629976287764, 0.9501167530989206, 0.8150067463693151, 0.39023676235941496], [0.8828748262092894, 0.4860044314968308, 0.5540128380695173, 0.8082435758911675, 0.8062795852887981, 0.9174691675570974, 0.2916788224043554, 0.681284171273599, 0.6617589029855675, 0.39463683385586124, 0.15722388362239081, 0.6787365838485361, 0.5300871536908168, 0.35202228312410244, 0.17418421388775895, 0.07580038442596893, 0.548714711703926, 0.396217127983882, 0.9019348251525908, 0.8616307603184107, 0.8069750672474115, 0.251527528970105, 0.9853738880285439, 0.00823101199851739, 0.9080965062346589, 0.4050124263265078, 0.4583766586283575, 0.4589221615079726, 0.48987769085345323, 0.2933561828054607, 0.37823502201676584, 0.004019015230476541], [0.3984969568599215, 0.32142206901196047, 0.39986098321416585, 0.36526823859910496, 0.823922100498845, 0.14031952025889238, 0.06258829998031368, 0.3374796913947139, 0.7886638216595123, 0.959057469132262, 0.6685569554200753, 0.3208730691286975, 0.4343040742288524, 0.9447930541729715, 0.6840310994385076, 0.8799435616127874, 0.23631841258967, 0.39803644482654277, 0.7790382401037865, 0.3197897008352285, 0.17955603826656297, 0.5572965432933942, 0.19859408359287378, 0.23261103058910115, 0.12022356354045638, 0.1700504490634076, 0.5483388310797792, 0.013904405543793463, 0.43478637086871863, 0.09310142364807417, 0.8090536682445805, 0.5576014155749502], [0.20957191181412727, 0.9510805554517028, 0.4201184282804482, 0.027116068027443263, 0.8905030681894481, 0.0741836062076554, 0.15197693796210132, 0.7708998657099158, 0.14844445107914206, 0.4290060859942789, 0.8743823709912927, 0.9170305226994173, 0.9268768829407644, 0.9669008734593614, 0.13912836861149525, 0.7132535413768417, 0.6761975480456264, 0.7013577928180705, 0.44895337325042184, 0.28685478656513286, 0.5179078485921049, 0.9478365342315525, 0.8038279858668054, 0.8019712093004978, 0.39788542885240297, 0.8397602672013882, 0.9197499500060854, 0.6837656717260908, 0.5735214188144572, 0.717254108596802, 0.8507495849256097, 0.9672281458243713], [0.8702226508020653, 0.316619291042471, 0.22966746155433415, 0.792045663604979, 0.7821606318601324, 0.4112522304766951, 0.30150270861647643, 0.42790816064276804, 0.9588560886101446, 0.5828368461461564, 0.8552659951975633, 0.3191530534357684, 0.8588663622316453, 0.3969881383984375, 0.3551481507191302, 0.1761424258389137, 0.3128906438200305, 0.1739253979684634, 0.04633352392842671, 0.6689385903414725, 0.4983799065006259, 0.4017536255325066, 0.274052248241787, 0.46203170945469807, 0.7862858608663373, 0.9996721640667675, 0.6805285729487011, 0.43903785323167155, 0.348185586027259, 0.8004485667051209, 0.3040172318737919, 0.24277236774350852], [0.9789159443168501, 0.5888625589461256, 0.17413188004718538, 0.3842493218752592, 0.9332833505052686, 0.03510281778234525, 0.26679558428368455, 0.9079664604033523, 0.011361119062656577, 0.2912042256456687, 0.7330266979414506, 0.9292002979200378, 0.274671379255192, 0.039507221104744805, 0.9164914574275309, 0.2715502760894316, 0.8425547628562307, 0.9568055331639759, 0.14781888909919505, 0.593038849974103, 0.10533733162542913, 0.020667109401068418, 0.9869790187840303, 0.6648714247043312, 0.2866274481278025, 0.6561066700551808, 0.34948571747914314, 0.8498779055371717, 0.4262467182875508, 0.010362801986821268, 0.7217193398261318, 0.6693244731390934], [0.2545532503729604, 0.737143336504784, 0.8301443313464892, 0.3766111532225398, 0.8774472516194247, 0.91387789818373, 0.2243498454674483, 0.36090509260146086, 0.14222878569516695, 0.0640146910270104, 0.09165313791323804, 0.06700109494000817, 0.2610415487308295, 0.571316462292597, 0.9902828940051094, 0.4130125389658469, 0.5986500555157689, 0.018577728369674862, 0.9296117295580698, 0.06418681328986098, 0.25860257944862186, 0.5326919281764336, 0.2604459741413362, 0.3935496047386987, 0.5802956174193308, 0.5949976034324846, 0.06830181151708303, 0.7491944525322899, 0.37484561426184027, 0.6091799685061612, 0.061643802258240066, 0.6273996586562092], [0.28950846496436045, 0.9925665722364245, 0.9646771860006074, 0.09867233410815468, 0.5145768879120812, 0.44608594449344086, 0.7888303609676927, 0.8658901810197285, 0.5400810677081935, 0.844060213949664, 0.11580493389961755, 0.12607065512418925, 0.34217537876595105, 0.937560695969719, 0.43526341818484704, 0.2335876660303423, 0.12389215824586908, 0.11039992097839635, 0.13297740430673444, 0.5000834831829486, 0.19846177950751331, 0.02823945139952644, 0.8005707960373998, 0.560561035071804, 0.7123738756818266, 0.9101033810684479, 0.4298744590134226, 0.6604136348428555, 0.39787828785785295, 0.050574300417547735, 0.42289739106472624, 0.07286550081119914], [0.5156652332650895, 0.562680521622005, 0.6957470074590942, 0.6881872689256676, 0.02471823817796659, 0.5397335964636125, 0.3965850755533674, 0.7421584469841247, 0.7167499831530989, 0.3705533759604078, 0.238476210182353, 0.27601644343144294, 0.34356588997619186, 0.8971965937294454, 0.25654762408565557, 0.25262883624788623, 0.08901300972001525, 0.7936402587303887, 0.1930404717430696, 0.1969253558026891, 0.9091394335020261, 0.895707808378619, 0.8000643128212639, 0.3857508309512372, 0.2658242766362766, 0.0670381012170358, 0.6727343077635156, 0.1499083887470134, 0.860019043697126, 0.6216180225793922, 0.11819614060242001, 0.6941699657657305]])
47
+ d = tf.random_uniform(SHAPES)
49
48
 
50
- p = tf.placeholder("float")
51
- q = tf.placeholder("float")
49
+ p = tf.placeholder('float')
50
+ q = tf.placeholder('float')
52
51
 
53
52
  model = -tf.sin(a.dot(b + p) + c).dot(a) + tf.cos(a.dot(d + q))
54
53
  single_function_test = (tf.sigmoid(a * p) * tf.sigmoid(b * q)) + c
@@ -58,18 +57,15 @@ matmul = tf.matmul(a, b)
58
57
  out_of_order = tf.matmul(a, b) + tf.matmul(a, c)
59
58
  softmax = tf.nn.softmax(a)
60
59
 
61
- sess = tf.session
62
- sess2 = tf.session(:opencl_evaluator)
60
+ puts TensorStream::Evaluator.default_evaluators
61
+
62
+ sess = tf.session(:ruby_evaluator)
63
+ sess2 = tf.session
63
64
 
64
- # verify correctness
65
- 10.times do
66
- feed = { p => rand, q => rand }
67
- x = sess.run(model, feed_dict: feed )
68
- y = sess2.run(model, feed_dict: feed )
69
- fail "not equal #{tr(x.first)} != #{tr(y.first)}" if tr(x) != tr(y)
70
- end
71
65
  puts `cat /proc/cpuinfo | grep "model name" | head -1`
72
- puts "OpenCL device #{sess2.last_session_context[:cl_device].platform} #{sess2.last_session_context[:cl_device].name}"
66
+ device = TensorStream::Evaluator::OpenclEvaluator.default_device.native_device
67
+ puts "OpenCL device #{device.platform.to_s} #{device.name}"
68
+
73
69
  Benchmark.bmbm do |x|
74
70
  x.report("pure ruby ooo matmul :") { 100.times do sess.run(out_of_order) end }
75
71
  x.report("opencl ooo matmul :") { 100.times do sess2.run(out_of_order) end }
@@ -3,14 +3,14 @@ module TensorStream
3
3
  class ControlFlow < Operation
4
4
  attr_accessor :ops
5
5
 
6
- def initialize(flow_type, items, ops = nil, options = {})
6
+ def initialize(flow_type, inputs, ops = nil, options = {})
7
7
  setup_initial_state(options)
8
8
 
9
9
  @operation = :"flow_#{flow_type}"
10
- @items = items
10
+ @inputs = inputs
11
11
  @name = [@graph.get_name_scope, options[:name] || set_name].compact.join('/')
12
12
  @ops = ops
13
- @shape = TensorShape.new([items.size])
13
+ @shape = TensorShape.new([inputs.size])
14
14
  @graph.add_node(self)
15
15
  end
16
16
 
@@ -7,11 +7,11 @@ module TensorStream
7
7
  nodes_to_process = graph.nodes.values.select { |node| node.is_a?(Operation) }
8
8
 
9
9
  nodes_to_process.each do |node|
10
- node.items = node.items.compact.collect do |item|
11
- if TensorStream::Ops::FLOATING_POINT_TYPES.include?(item.data_type)
12
- TensorStream.check_numerics(item, "#{node.name}/#{item.name}", name: "check/#{node.name}/#{item.name}" )
10
+ node.inputs = node.inputs.compact.collect do |input|
11
+ if TensorStream::Ops::FLOATING_POINT_TYPES.include?(input.data_type)
12
+ TensorStream.check_numerics(input, "#{node.name}/#{input.name}", name: "check/#{node.name}/#{input.name}" )
13
13
  else
14
- item
14
+ input
15
15
  end
16
16
  end
17
17
  end
@@ -1,8 +1,11 @@
1
+ # A tensorstream device
1
2
  module TensorStream
2
3
  class Device
3
- attr_accessor :name
4
- def initialize(name)
4
+ attr_accessor :name, :type, :evaluator
5
+ def initialize(name, type, evaluator)
5
6
  @name = name
7
+ @type = type
8
+ @evaluator = evaluator
6
9
  end
7
10
  end
8
11
  end
@@ -0,0 +1,138 @@
1
+ module TensorStream
2
+ module Evaluator
3
+ class UnsupportedOp < Exception
4
+ def initialize(tensor)
5
+ @tensor = tensor
6
+ end
7
+
8
+ def message
9
+ "unsupported op #{@tensor.operation}"
10
+ end
11
+ end
12
+
13
+ class BaseEvaluator
14
+ def initialize(session, device, thread_pool: nil, log_intermediates: false)
15
+ @session = session
16
+ @log_intermediates = log_intermediates
17
+ @thread_pool = thread_pool || Concurrent::ImmediateExecutor.new
18
+ @context[:compute_history] = [] if log_intermediates
19
+ end
20
+
21
+ def self.query_supported_devices
22
+ [Device.new("cpu", :cpu, self)]
23
+ end
24
+
25
+ ##
26
+ # Select the best device available in the system for this evaluator
27
+ def self.default_device
28
+ Device.new("cpu", :cpu, self)
29
+ end
30
+
31
+ ##
32
+ # Selects the best device with the specified query, query can
33
+ # be evaluator specific
34
+ def self.fetch_device(query = [])
35
+ Device.new("cpu", :cpu, self)
36
+ end
37
+
38
+ def self.query_device(query)
39
+ return default_device if query.nil? || query == :default
40
+
41
+ all_devices = query_supported_devices
42
+ substrs = query.split('/')
43
+ substrs.each do |q|
44
+ components = q.split(':')
45
+ next if components.size.zero?
46
+ if components[0] == 'device' # use tensorflow convention
47
+ device_type = components[1]
48
+ select_index = components[2].to_i
49
+
50
+ devices = all_devices.select { |d| d.type == device_type.downcase.to_sym }
51
+ return nil if devices.empty?
52
+
53
+ select_index = [devices.size - 1, select_index].min
54
+ return devices[select_index]
55
+ elsif components[0] == 'cpu'
56
+ device_type = :cpu
57
+ select_index = components[1].to_i
58
+
59
+ devices = all_devices.select { |d| d.type == device_type.downcase.to_sym }
60
+ return nil if devices.empty?
61
+
62
+ select_index = [devices.size - 1, select_index].min
63
+ return devices[select_index]
64
+ elsif components[0] == 'ts' # tensorstream specific
65
+ evaluator_class = TensorStream::Evaluator.evaluators[components[1]][:class]
66
+ return nil unless self == evaluator_class
67
+ return evaluator_class.fetch_device(components[2..components.size]) if evaluator_class.respond_to?(:fetch_device)
68
+ return nil
69
+ end
70
+ end
71
+ end
72
+
73
+ ##
74
+ # registers an op for the current evaluator class
75
+ def self.register_op(opcode, options = {}, &block)
76
+ @ops ||= {}
77
+ if opcode.is_a?(Array)
78
+ opcode.each do |op|
79
+ @ops[op.to_sym] = { options: options, block: block }
80
+ end
81
+ else
82
+
83
+ @ops[opcode.to_sym] = { options: options, block: block }
84
+ end
85
+ end
86
+
87
+ ##
88
+ # gets all supported ops for this Evaluator class
89
+ def self.ops
90
+ @ops ||={}
91
+ end
92
+
93
+ def invoke(tensor, execution_context)
94
+ if self.class.ops.key?(tensor.operation.to_sym)
95
+ op = self.class.ops[tensor.operation.to_sym]
96
+ op_options = op[:options]
97
+ resolved_inputs = tensor.inputs.map do |i|
98
+ next if i.nil?
99
+ if @context[:_cache][:placement][tensor.name] != @context[:_cache][:placement][i.name] # tensor is on another device or evaluator
100
+ result = @session.delegate_to_evaluator(i, @context, execution_context)
101
+ convert_from_buffer(i, result)
102
+ else
103
+ prepare_input(i, execution_context, op_options)
104
+ end
105
+ end
106
+ instance_exec(execution_context, tensor, resolved_inputs, &op[:block])
107
+ else
108
+ raise UnsupportedOp.new(tensor)
109
+ end
110
+ end
111
+
112
+ protected
113
+
114
+ ##
115
+ # converts from a ruby Buffer object to the evaluator's native buffer format
116
+ def convert_from_buffer(tensor, result)
117
+ raise "need implementation"
118
+ end
119
+
120
+ def prepare_input(tensor, context, options = {})
121
+ raise "need implementation"
122
+ end
123
+ end
124
+
125
+ def self.evaluators
126
+ @evaluators ||= {}
127
+ end
128
+
129
+ def self.register_evaluator(klass, name, index = 0)
130
+ @evaluators ||= {}
131
+ @evaluators[name] = { name: name, class: klass, index: index }
132
+ end
133
+
134
+ def self.default_evaluators
135
+ evaluators.values.sort { |v| v[:index] }.reverse.map { |v| v[:class] }
136
+ end
137
+ end
138
+ end
@@ -1,10 +1,15 @@
1
1
  module TensorStream
2
2
  # this class represents an evaluator specific native buffer
3
3
  class Buffer
4
- attr_accessor :dirty, :name
4
+ attr_accessor :data_type, :buffer, :dirty, :name
5
+
6
+ def initialize(data_type:, buffer:)
7
+ @data_type = data_type
8
+ @buffer = buffer
9
+ end
5
10
 
6
11
  def to_ruby
7
- raise "not implemented"
12
+ buffer
8
13
  end
9
14
  end
10
15
  end
@@ -1,5 +1,5 @@
1
1
  // same dimension add floating point op
2
- __kernel void <%= fname%>_<%= dtype %>(const int M, const int N, const int switch_op, __global const <%= c_dtype %> *A, __global <%= c_dtype %> *B, __global <%= result_t %> *C) {
2
+ __kernel void <%= fname%>_<%= dtype %>(const int M, const int N, const int switch_op, __global const <%= a_dtype %> *A, __global <%= b_dtype %> *B, __global <%= result_t %> *C) {
3
3
  // Get the index of the current element to be processed
4
4
  const int globalRow = get_global_id(0); // Row ID of C (0..M)
5
5
  const int globalCol = get_global_id(1); // Col ID of C (0..N)
@@ -8,7 +8,7 @@
8
8
  }
9
9
 
10
10
  // 1D + Scalar floating point add op
11
- __kernel void <%=fname%>_c_<%= dtype %>(const int M, const int N, const int switch_op, __global const <%= c_dtype %> *A, __global <%= c_dtype %> *B, __global <%= result_t %> *C) {
11
+ __kernel void <%=fname%>_c_<%= dtype %>(const int M, const int N, const int switch_op, __global const <%= a_dtype %> *A, __global <%= b_dtype %> *B, __global <%= result_t %> *C) {
12
12
  // Get the index of the current element to be processed
13
13
  const int globalRow = get_global_id(0); // Row ID of C (0..M)
14
14
  const int globalCol = get_global_id(1); // Col ID of C (0..N)
@@ -21,7 +21,7 @@
21
21
  }
22
22
 
23
23
  // 1D + Scalar floating point add op broadcast
24
- __kernel void <%= fname%>_b_<%= dtype %>(const int M, const int N, const int M2, const int N2, const int switch_op,__global const <%= c_dtype %> *A, __global <%= c_dtype %> *B, __global <%= result_t %> *C) {
24
+ __kernel void <%= fname%>_b_<%= dtype %>(const int M, const int N, const int M2, const int N2, const int switch_op,__global const <%= a_dtype %> *A, __global <%= b_dtype %> *B, __global <%= result_t %> *C) {
25
25
  // Get the index of the current element to be processed
26
26
  const int globalRow = get_global_id(0); // Row ID of C (0..M)
27
27
  const int globalCol = get_global_id(1); // Col ID of C (0..N)