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
@@ -6,13 +6,29 @@ module TensorStream
6
6
  attr_reader :last_session_context, :closed, :target, :session_cache
7
7
  attr_accessor :randomizer
8
8
 
9
- def initialize(evaluator = :ruby_evaluator, thread_pool_class: Concurrent::ImmediateExecutor, evaluator_options: {})
10
- @evaluator_class = Object.const_get("TensorStream::Evaluator::#{camelize(evaluator.to_s)}")
9
+ def initialize(evaluator = nil, thread_pool_class: Concurrent::ImmediateExecutor, log_device_placement: false, evaluator_options: {})
11
10
  @thread_pool = thread_pool_class.new
12
11
  @closed = false
13
12
  @session_cache = {}
14
13
  @randomizer = {}
14
+ @log_device_placement = log_device_placement
15
15
  @evaluator_options = evaluator_options
16
+ get_evaluator_classes(evaluator)
17
+ @evaluators = {}
18
+ end
19
+
20
+ def get_evaluator_classes(evaluators)
21
+ @evaluator_classes = if evaluators.is_a?(Array)
22
+ if evaluators.empty?
23
+ TensorStream::Evaluator.default_evaluators
24
+ else
25
+ evaluators.collect { |name| Object.const_get("TensorStream::Evaluator::#{camelize(name.to_s)}") }
26
+ end
27
+ elsif evaluators.nil?
28
+ TensorStream::Evaluator.default_evaluators
29
+ else
30
+ [Object.const_get("TensorStream::Evaluator::#{camelize(evaluators.to_s)}")]
31
+ end
16
32
  end
17
33
 
18
34
  def clear_session_cache
@@ -44,16 +60,31 @@ module TensorStream
44
60
 
45
61
  @evaluator_options[:thread_pool] = @thread_pool
46
62
  @evaluator_options[:log_intermediates] = options[:log_intermediates]
47
- evaluator = @evaluator_class.new(self, context.merge!(retain: options[:retain]), @evaluator_options)
48
63
 
49
- execution_context = {}
64
+ args.each { |t| prepare_evaluators(t, context) }
50
65
  @last_session_context = context
51
- result = args.collect { |e| evaluator.run(e, execution_context) }
66
+
67
+ if @log_device_placement
68
+ context[:_cache][:placement].each do |k, v|
69
+ puts "#{k} : #{v[0].name}"
70
+ end
71
+ end
72
+ result = args.collect do |e|
73
+ value = delegate_to_evaluator(e, context, {})
74
+ value.respond_to?(:to_ruby) ? value.to_ruby : value
75
+ end
76
+
77
+
78
+
52
79
  result.size == 1 ? result.first : result
53
80
  end
54
81
 
55
82
  def list_devices
56
- [Device.new("cpu")]
83
+ TensorStream::Evaluator.evaluators.collect do |k, v|
84
+ v[:class].query_supported_devices.collect do |device|
85
+ device
86
+ end
87
+ end.flatten
57
88
  end
58
89
 
59
90
  def close
@@ -74,14 +105,56 @@ module TensorStream
74
105
 
75
106
  def dump_ops(tensor, selector)
76
107
  graph = tensor.graph
77
- graph.nodes.select { |k, v| selector.call(k, v) }.collect do |k, node|
108
+ graph.nodes.select { |k, v| selector.call(k, v) }.collect { |k, node|
78
109
  next unless @last_session_context[node.name]
79
110
  "#{k} #{node.to_math(true, 1)} = #{@last_session_context[node.name]}"
80
- end.compact
111
+ }.compact
81
112
  end
82
113
 
83
114
  def graph_ml(tensor, filename)
84
115
  TensorStream::Graphml.new(self).serialize(tensor, filename)
85
116
  end
117
+
118
+ def delegate_to_evaluator(tensor_arr, session_context, context)
119
+ arr = tensor_arr.is_a?(Array) ? tensor_arr : [tensor_arr]
120
+ result = arr.collect do |tensor|
121
+ session_context[:_cache][:placement][tensor.name][1].run_with_buffer(tensor, session_context, context)
122
+ end
123
+ result.size == 1 ? result.first : result
124
+ end
125
+
126
+ protected
127
+
128
+ def assign_evaluator(tensor)
129
+ device = @evaluator_classes.map do |klass|
130
+ next nil if tensor.is_a?(Operation) && !klass.ops.include?(tensor.operation.to_sym)
131
+ next klass.default_device if tensor.device.nil?
132
+
133
+ klass.query_device(tensor.device)
134
+ end.compact.first
135
+
136
+ raise "no evaluator available to execute #{tensor.operation}" if device.nil?
137
+
138
+ key = "#{device.evaluator.to_s}/#{device.name}"
139
+ if @evaluators.key?(key)
140
+ @evaluators[key]
141
+ else
142
+ @evaluators[key] = [device, device.evaluator.new(self, device)]
143
+ end
144
+ end
145
+
146
+ def prepare_evaluators(tensor_arr, context)
147
+ context[:_cache][:placement] ||= {}
148
+
149
+ tensor_arr = tensor_arr.is_a?(Array) ? tensor_arr : [tensor_arr]
150
+ tensor_arr.each do |tensor|
151
+ next if context[:_cache][:placement][tensor.name]
152
+
153
+ graph = tensor.graph
154
+ graph.nodes.values.each do |node|
155
+ context[:_cache][:placement][node.name] = assign_evaluator(node)
156
+ end
157
+ end
158
+ end
86
159
  end
87
160
  end
@@ -7,7 +7,7 @@ module TensorStream
7
7
 
8
8
  attr_accessor :name, :data_type, :shape, :rank, :native_buffer, :is_const,
9
9
  :value, :breakpoint, :internal, :source, :given_name, :graph,
10
- :consumers, :outputs
10
+ :consumers, :outputs, :device
11
11
 
12
12
  def initialize(data_type, rank, shape, options = {})
13
13
  setup_initial_state(options)
@@ -28,7 +28,7 @@ module TensorStream
28
28
  options[:value] = reshape(options[:value], shape.reverse.dup) if shape.size >= 2 && !options[:value].empty? && !options[:value][0].is_a?(Array)
29
29
 
30
30
  @value = options[:value].collect do |v|
31
- v.is_a?(Tensor) ? Tensor.cast_dtype(v, data_type) : v
31
+ v.is_a?(Tensor) ? Tensor.cast_dtype(v, @data_type) : v
32
32
  end
33
33
  elsif !shape.empty?
34
34
  @value = reshape(Tensor.cast_dtype(options[:value], @data_type), shape.dup)
@@ -189,14 +189,16 @@ module TensorStream
189
189
  end
190
190
 
191
191
  def self.detect_type(value)
192
- if value.is_a?(String)
192
+ if !!value==value
193
+ :boolean
194
+ elsif value.is_a?(String)
193
195
  :string
194
196
  elsif value.is_a?(Float)
195
197
  :float32
196
198
  elsif value.is_a?(Integer)
197
199
  :int32
198
200
  elsif value.is_a?(Array)
199
- :array
201
+ return detect_type(value[0])
200
202
  else
201
203
  :float32
202
204
  end
@@ -225,7 +227,7 @@ module TensorStream
225
227
  end
226
228
  when :string
227
229
  val.to_s
228
- when :int32, :int16
230
+ when :int32, :int16, :int
229
231
  if !!val == val
230
232
  val ? 1 : 0
231
233
  else
@@ -28,6 +28,19 @@ module TensorStream
28
28
  TensorStream::Graph.get_default_graph.executing_eagerly?
29
29
  end
30
30
 
31
+ ##
32
+ # List available evaluators + devices in the current local environment
33
+ # Returns:
34
+ # - An array containing the names of those devices
35
+ def list_local_devices
36
+ local_name = 'job:localhost'
37
+ TensorStream::Evaluator.evaluators.collect do |k, v|
38
+ v[:class].query_supported_devices.collect do |device_str|
39
+ [local_name, "ts:#{k}:#{device_str.name}"].join('/')
40
+ end
41
+ end.flatten
42
+ end
43
+
31
44
  def variable(value, name: nil, initializer: nil, graph: nil, dtype: nil, trainable: true)
32
45
  op = Operation.new(:assign, nil, value)
33
46
  common_options = {
@@ -46,7 +59,7 @@ module TensorStream
46
59
  else
47
60
  TensorStream::Variable.new(dtype || :float32, 0, nil, common_options)
48
61
  end
49
- op.items[0] = tensor
62
+ op.inputs[0] = tensor
50
63
  tensor
51
64
  end
52
65
 
@@ -65,6 +78,10 @@ module TensorStream
65
78
  end
66
79
  end
67
80
 
81
+ def device(device_uri, &block)
82
+ get_default_graph.device(device_uri, &block)
83
+ end
84
+
68
85
  def name_scope(name, default: nil, values: nil)
69
86
  if values
70
87
  graph_count = values.select { |v| v.is_a?(Tensor) }.map(&:graph).map(&:object_id).uniq.size
@@ -85,8 +102,8 @@ module TensorStream
85
102
  Thread.current[:tensor_stream_variable_scope].map(&:name).compact.reject(&:empty?).join('/')
86
103
  end
87
104
 
88
- def session(evaluator = :ruby_evaluator, thread_pool_class: Concurrent::ImmediateExecutor)
89
- session = TensorStream::Session.new(evaluator, thread_pool_class: thread_pool_class)
105
+ def session(evaluator = nil, thread_pool_class: Concurrent::ImmediateExecutor, log_device_placement: false)
106
+ session = TensorStream::Session.new(evaluator, thread_pool_class: thread_pool_class, log_device_placement: log_device_placement)
90
107
  yield session if block_given?
91
108
 
92
109
  session
@@ -100,27 +117,23 @@ module TensorStream
100
117
  TensorStream::Layers
101
118
  end
102
119
 
103
- def constant(value, options = {})
104
- shared_options = { const: true, value: value, name: options[:name] }
120
+ def constant(value, dtype: nil, shape: nil, internal: false, name: 'Const')
121
+ shared_options = { const: true, value: value, name: name, internal: internal }
105
122
  if value.is_a?(Float)
106
- TensorStream::Tensor.new(options[:dtype] || :float32, 0, options[:shape] || [], shared_options)
123
+ TensorStream::Tensor.new(dtype || :float32, 0, shape || [], shared_options)
107
124
  elsif value.is_a?(Integer)
108
- TensorStream::Tensor.new(options[:dtype] || :int32, 0, options[:shape] || [], shared_options)
125
+ TensorStream::Tensor.new(dtype || :int32, 0, shape || [], shared_options)
109
126
  elsif value.is_a?(String)
110
- TensorStream::Tensor.new(options[:dtype] || :string, 0, options[:shape] || [], shared_options)
127
+ TensorStream::Tensor.new(dtype || :string, 0, shape || [], shared_options)
111
128
  elsif value.is_a?(Array)
112
- dtype = nil
113
- rank = 1
114
- dimensions = []
115
- value_ptr = value
116
-
117
- Kernel.loop do
118
- dtype, rank, value_ptr, d = dtype_eval(rank, value_ptr)
119
- dimensions << d
120
- break if dtype != :array
121
- end
129
+ dimension = shape || shape_eval(value)
130
+ rank = dimension.size
131
+
132
+ cur_dtype = dtype || Tensor.detect_type(value.flatten.last)
133
+ value = Tensor.cast_dtype(value, cur_dtype) unless dtype.nil?
122
134
 
123
- TensorStream::Tensor.new(dtype, rank, options[:shape] || dimensions, shared_options)
135
+ shared_options[:value] = value
136
+ TensorStream::Tensor.new(cur_dtype, rank, dimension, shared_options)
124
137
  end
125
138
  end
126
139
 
@@ -1,5 +1,5 @@
1
1
  module TensorStream
2
- VERSION = '0.4.1'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
 
4
4
  def self.version
5
5
  VERSION
@@ -44,5 +44,4 @@ Gem::Specification.new do |spec|
44
44
  spec.add_dependency "deep_merge"
45
45
  spec.add_dependency "concurrent-ruby"
46
46
  spec.add_dependency "sciruby"
47
- spec.add_dependency "distribution"
48
47
  end
@@ -38,15 +38,15 @@ Y = tf.placeholder(:float64, shape: [nil, num_classes])
38
38
 
39
39
  # Store layers weight & bias
40
40
  weights = {
41
- 'h1' => tf.variable(tf.random_normal([num_input, n_hidden_1]), dtype: :float64),
42
- 'h2' => tf.variable(tf.random_normal([n_hidden_1, n_hidden_2]), dtype: :float64),
43
- 'out' => tf.variable(tf.random_normal([n_hidden_2, num_classes]), dtype: :float64)
41
+ 'h1' => tf.variable(tf.random_normal([num_input, n_hidden_1]), dtype: :float64, name: 'h1'),
42
+ 'h2' => tf.variable(tf.random_normal([n_hidden_1, n_hidden_2]), dtype: :float64, name: 'h2'),
43
+ 'out' => tf.variable(tf.random_normal([n_hidden_2, num_classes]), dtype: :float64, name: 'out')
44
44
  }
45
45
 
46
46
  biases = {
47
- 'b1' => tf.variable(tf.random_normal([n_hidden_1]), dtype: :float64),
48
- 'b2' => tf.variable(tf.random_normal([n_hidden_2]), dtype: :float64),
49
- 'out' => tf.variable(tf.random_normal([num_classes]), dtype: :float64)
47
+ 'b1' => tf.variable(tf.random_normal([n_hidden_1]), dtype: :float64, name: 'b1'),
48
+ 'b2' => tf.variable(tf.random_normal([n_hidden_2]), dtype: :float64, name: 'b2'),
49
+ 'out' => tf.variable(tf.random_normal([num_classes]), dtype: :float64, name: 'out2')
50
50
  }
51
51
 
52
52
 
@@ -82,7 +82,7 @@ accuracy = tf.reduce_mean(tf.cast(correct_pred, :float32))
82
82
  init = tf.global_variables_initializer
83
83
 
84
84
  # Start training
85
- tf.session(:opencl_evaluator) do |sess|
85
+ tf.session do |sess|
86
86
  # Run the initializer
87
87
  sess.run(init)
88
88
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tensor_stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Emmanuel Dayo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-17 00:00:00.000000000 Z
11
+ date: 2018-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -206,20 +206,6 @@ dependencies:
206
206
  - - ">="
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
- - !ruby/object:Gem::Dependency
210
- name: distribution
211
- requirement: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - ">="
214
- - !ruby/object:Gem::Version
215
- version: '0'
216
- type: :runtime
217
- prerelease: false
218
- version_requirements: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - ">="
221
- - !ruby/object:Gem::Version
222
- version: '0'
223
209
  description: A reimplementation of TensorFlow for ruby. This is a ground up implementation
224
210
  with no dependency on TensorFlow. Effort has been made to make the programming style
225
211
  as near to TensorFlow as possible, comes with a pure ruby evaluator by default as
@@ -252,44 +238,46 @@ files:
252
238
  - lib/tensor_stream/control_flow.rb
253
239
  - lib/tensor_stream/debugging/debugging.rb
254
240
  - lib/tensor_stream/device.rb
241
+ - lib/tensor_stream/evaluator/base_evaluator.rb
255
242
  - lib/tensor_stream/evaluator/buffer.rb
256
243
  - lib/tensor_stream/evaluator/evaluator.rb
257
- - lib/tensor_stream/evaluator/kernels/_bool_operand.cl
258
- - lib/tensor_stream/evaluator/kernels/_operand.cl
259
- - lib/tensor_stream/evaluator/kernels/abs.cl
260
- - lib/tensor_stream/evaluator/kernels/add.cl
261
- - lib/tensor_stream/evaluator/kernels/argmax.cl
262
- - lib/tensor_stream/evaluator/kernels/argmin.cl
263
- - lib/tensor_stream/evaluator/kernels/cast.cl
264
- - lib/tensor_stream/evaluator/kernels/cond.cl.erb
265
- - lib/tensor_stream/evaluator/kernels/cos.cl
266
- - lib/tensor_stream/evaluator/kernels/div.cl.erb
267
- - lib/tensor_stream/evaluator/kernels/exp.cl
268
- - lib/tensor_stream/evaluator/kernels/gemm.cl
269
- - lib/tensor_stream/evaluator/kernels/log.cl
270
- - lib/tensor_stream/evaluator/kernels/log1p.cl
271
- - lib/tensor_stream/evaluator/kernels/max.cl
272
- - lib/tensor_stream/evaluator/kernels/mul.cl
273
- - lib/tensor_stream/evaluator/kernels/negate.cl
274
- - lib/tensor_stream/evaluator/kernels/pow.cl
275
- - lib/tensor_stream/evaluator/kernels/reciprocal.cl
276
- - lib/tensor_stream/evaluator/kernels/round.cl
277
- - lib/tensor_stream/evaluator/kernels/sigmoid.cl
278
- - lib/tensor_stream/evaluator/kernels/sigmoid_grad.cl
279
- - lib/tensor_stream/evaluator/kernels/sign.cl
280
- - lib/tensor_stream/evaluator/kernels/sin.cl
281
- - lib/tensor_stream/evaluator/kernels/softmax.cl
282
- - lib/tensor_stream/evaluator/kernels/softmax_grad.cl
283
- - lib/tensor_stream/evaluator/kernels/sqrt.cl
284
- - lib/tensor_stream/evaluator/kernels/square.cl
285
- - lib/tensor_stream/evaluator/kernels/sub.cl
286
- - lib/tensor_stream/evaluator/kernels/tan.cl
287
- - lib/tensor_stream/evaluator/kernels/tanh.cl
288
- - lib/tensor_stream/evaluator/kernels/tanh_grad.cl
289
- - lib/tensor_stream/evaluator/kernels/where.cl
290
- - lib/tensor_stream/evaluator/opencl_buffer.rb
291
- - lib/tensor_stream/evaluator/opencl_evaluator.rb
292
- - lib/tensor_stream/evaluator/opencl_template_helper.rb
244
+ - lib/tensor_stream/evaluator/opencl/kernels/_bool_operand.cl
245
+ - lib/tensor_stream/evaluator/opencl/kernels/_operand.cl
246
+ - lib/tensor_stream/evaluator/opencl/kernels/abs.cl
247
+ - lib/tensor_stream/evaluator/opencl/kernels/add.cl
248
+ - lib/tensor_stream/evaluator/opencl/kernels/argmax.cl
249
+ - lib/tensor_stream/evaluator/opencl/kernels/argmin.cl
250
+ - lib/tensor_stream/evaluator/opencl/kernels/cast.cl
251
+ - lib/tensor_stream/evaluator/opencl/kernels/cond.cl.erb
252
+ - lib/tensor_stream/evaluator/opencl/kernels/cos.cl
253
+ - lib/tensor_stream/evaluator/opencl/kernels/div.cl.erb
254
+ - lib/tensor_stream/evaluator/opencl/kernels/exp.cl
255
+ - lib/tensor_stream/evaluator/opencl/kernels/gemm.cl
256
+ - lib/tensor_stream/evaluator/opencl/kernels/log.cl
257
+ - lib/tensor_stream/evaluator/opencl/kernels/log1p.cl
258
+ - lib/tensor_stream/evaluator/opencl/kernels/max.cl
259
+ - lib/tensor_stream/evaluator/opencl/kernels/mul.cl
260
+ - lib/tensor_stream/evaluator/opencl/kernels/negate.cl
261
+ - lib/tensor_stream/evaluator/opencl/kernels/pow.cl
262
+ - lib/tensor_stream/evaluator/opencl/kernels/reciprocal.cl
263
+ - lib/tensor_stream/evaluator/opencl/kernels/round.cl
264
+ - lib/tensor_stream/evaluator/opencl/kernels/sigmoid.cl
265
+ - lib/tensor_stream/evaluator/opencl/kernels/sigmoid_grad.cl
266
+ - lib/tensor_stream/evaluator/opencl/kernels/sign.cl
267
+ - lib/tensor_stream/evaluator/opencl/kernels/sin.cl
268
+ - lib/tensor_stream/evaluator/opencl/kernels/softmax.cl
269
+ - lib/tensor_stream/evaluator/opencl/kernels/softmax_grad.cl
270
+ - lib/tensor_stream/evaluator/opencl/kernels/sqrt.cl
271
+ - lib/tensor_stream/evaluator/opencl/kernels/square.cl
272
+ - lib/tensor_stream/evaluator/opencl/kernels/sub.cl
273
+ - lib/tensor_stream/evaluator/opencl/kernels/tan.cl
274
+ - lib/tensor_stream/evaluator/opencl/kernels/tanh.cl
275
+ - lib/tensor_stream/evaluator/opencl/kernels/tanh_grad.cl
276
+ - lib/tensor_stream/evaluator/opencl/kernels/where.cl
277
+ - lib/tensor_stream/evaluator/opencl/opencl_buffer.rb
278
+ - lib/tensor_stream/evaluator/opencl/opencl_device.rb
279
+ - lib/tensor_stream/evaluator/opencl/opencl_evaluator.rb
280
+ - lib/tensor_stream/evaluator/opencl/opencl_template_helper.rb
293
281
  - lib/tensor_stream/evaluator/operation_helpers/array_ops_helper.rb
294
282
  - lib/tensor_stream/evaluator/operation_helpers/math_helper.rb
295
283
  - lib/tensor_stream/evaluator/operation_helpers/random_gaussian.rb
@@ -352,7 +340,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
352
340
  version: '0'
353
341
  requirements: []
354
342
  rubyforge_project:
355
- rubygems_version: 2.6.11
343
+ rubygems_version: 2.6.10
356
344
  signing_key:
357
345
  specification_version: 4
358
346
  summary: A Pure ruby tensorflow implementation
@@ -1,5 +0,0 @@
1
- % ["#{dtype}"].product(%w[less less_equal equal not_equal greater greater_equal logical_and]).each do |dtype, fname|
2
- % c_dtype = dtype_to_c_type(dtype)
3
- % op = operator_to_c(fname)
4
- <%= render 'bool_operand.cl', c_dtype: c_dtype, op: op, fname: fname, dtype: dtype, result_t: 'int' %>
5
- % end