class TensorStream::RubyStorageManager

Public Class Methods

current_storage_manager() click to toggle source
# File lib/tensor_stream/evaluator/ruby/storage_manager.rb, line 3
def self.current_storage_manager
  @storage_manager ||= RubyStorageManager.new
end
new() click to toggle source
# File lib/tensor_stream/evaluator/ruby/storage_manager.rb, line 7
def initialize
  @variables = {}
end

Public Instance Methods

assign_value(graph, name, value) click to toggle source
# File lib/tensor_stream/evaluator/ruby/storage_manager.rb, line 23
def assign_value(graph, name, value)
  raise "no name specified" if name.nil?

  @variables[graph.object_id] ||= {}
  @variables[graph.object_id][name.to_sym] = value
end
clear_variables(graph) click to toggle source
# File lib/tensor_stream/evaluator/ruby/storage_manager.rb, line 36
def clear_variables(graph)
  @variables[graph.object_id] = {}
end
create_variable(graph, name, value) click to toggle source
# File lib/tensor_stream/evaluator/ruby/storage_manager.rb, line 17
def create_variable(graph, name, value)
  raise "no name specified" if name.nil?

  @variables[graph.object_id][name.to_sym] = value
end
exists?(graph, name) click to toggle source
# File lib/tensor_stream/evaluator/ruby/storage_manager.rb, line 11
def exists?(graph, name)
  return false if !@variables.key?(graph.object_id)

  @variables[graph.object_id].key?(name.to_sym)
end
read_value(graph, name) click to toggle source
# File lib/tensor_stream/evaluator/ruby/storage_manager.rb, line 30
def read_value(graph, name)
  raise "no name specified" if name.nil?

  @variables[graph.object_id][name.to_sym]
end