Class: Tensorflow::Printers::GraphDef

Inherits:
Object
  • Object
show all
Defined in:
lib/tensorflow/printers/graph_def.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(graph_def) ⇒ GraphDef

Returns a new instance of GraphDef.



8
9
10
# File 'lib/tensorflow/printers/graph_def.rb', line 8

def initialize(graph_def)
  @graph_def = graph_def
end

Instance Attribute Details

#graph_defObject (readonly)

Returns the value of attribute graph_def.



6
7
8
# File 'lib/tensorflow/printers/graph_def.rb', line 6

def graph_def
  @graph_def
end

Instance Method Details



19
20
21
22
23
# File 'lib/tensorflow/printers/graph_def.rb', line 19

def print(io_stream=STDOUT)
  #io_stream << ERB.new(self.template, nil, trim_mode: "<>").result_with_hash(:graph_def => self.graph_def)
  raw = Erubi::Engine.new(self.template, filename: 'graph_def.erb')
  io_stream << eval(raw.src)
end

#templateObject



12
13
14
15
16
17
# File 'lib/tensorflow/printers/graph_def.rb', line 12

def template
  @template ||= begin
    path = File.join(__dir__, 'graph_def.erb')
    File.read(path, :mode => 'rb')
  end
end