Class: Tensorflow::Printers::GraphDef
- Inherits:
-
Object
- Object
- Tensorflow::Printers::GraphDef
- Defined in:
- lib/tensorflow/printers/graph_def.rb
Instance Attribute Summary collapse
-
#graph_def ⇒ Object
readonly
Returns the value of attribute graph_def.
Instance Method Summary collapse
-
#initialize(graph_def) ⇒ GraphDef
constructor
A new instance of GraphDef.
- #print(io_stream = STDOUT) ⇒ Object
- #template ⇒ Object
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_def ⇒ Object (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
#print(io_stream = STDOUT) ⇒ Object
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 |
#template ⇒ Object
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 |