Class: Tensorflow::Printers::Graph
- Inherits:
-
Object
- Object
- Tensorflow::Printers::Graph
- Defined in:
- lib/tensorflow/printers/graph.rb
Instance Attribute Summary collapse
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
Instance Method Summary collapse
-
#initialize(graph) ⇒ Graph
constructor
A new instance of Graph.
- #print(io_stream = STDOUT) ⇒ Object
- #template ⇒ Object
Constructor Details
#initialize(graph) ⇒ Graph
Returns a new instance of Graph.
8 9 10 |
# File 'lib/tensorflow/printers/graph.rb', line 8 def initialize(graph) @graph = graph end |
Instance Attribute Details
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
6 7 8 |
# File 'lib/tensorflow/printers/graph.rb', line 6 def graph @graph end |
Instance Method Details
#print(io_stream = STDOUT) ⇒ Object
19 20 21 22 23 |
# File 'lib/tensorflow/printers/graph.rb', line 19 def print(io_stream=STDOUT) #io_stream << ERB.new(self.template, nil, trim_mode: "<>").result_with_hash(:graph => self.graph) raw = Erubi::Engine.new(self.template, filename: 'graph.erb') io_stream << eval(raw.src) end |
#template ⇒ Object
12 13 14 15 16 17 |
# File 'lib/tensorflow/printers/graph.rb', line 12 def template @template ||= begin path = File.join(__dir__, 'graph.erb') File.read(path, :mode => 'rb') end end |