Class: Tensorflow::Graph::OperationOutput
- Inherits:
-
Object
- Object
- Tensorflow::Graph::OperationOutput
- Defined in:
- lib/tensorflow/graph/operation_output.rb
Instance Attribute Summary collapse
-
#operation ⇒ Object
readonly
Returns the value of attribute operation.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Class Method Summary collapse
- .from_graph(graph, pointer) ⇒ Object
- .from_index(operation, index) ⇒ Object
- .from_pointer(operation, pointer) ⇒ Object
Instance Method Summary collapse
- #index ⇒ Object
-
#initialize(operation, output) ⇒ OperationOutput
constructor
A new instance of OperationOutput.
- #to_ptr ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(operation, output) ⇒ OperationOutput
Returns a new instance of OperationOutput.
24 25 26 27 |
# File 'lib/tensorflow/graph/operation_output.rb', line 24 def initialize(operation, output) @operation = operation @output = output end |
Instance Attribute Details
#operation ⇒ Object (readonly)
Returns the value of attribute operation.
4 5 6 |
# File 'lib/tensorflow/graph/operation_output.rb', line 4 def operation @operation end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
4 5 6 |
# File 'lib/tensorflow/graph/operation_output.rb', line 4 def output @output end |
Class Method Details
.from_graph(graph, pointer) ⇒ Object
18 19 20 21 22 |
# File 'lib/tensorflow/graph/operation_output.rb', line 18 def self.from_graph(graph, pointer) output = FFI::Output.new(pointer) operation = Operation.new(graph, output[:oper]) self.new(operation, output) end |
Instance Method Details
#index ⇒ Object
33 34 35 |
# File 'lib/tensorflow/graph/operation_output.rb', line 33 def index self.output[:index] end |
#to_ptr ⇒ Object
29 30 31 |
# File 'lib/tensorflow/graph/operation_output.rb', line 29 def to_ptr @output.to_ptr end |
#to_s ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/tensorflow/graph/operation_output.rb', line 37 def to_s if self.output result = [self.operation.op_type] result << "name=#{self.operation.name}" result << "#{self.index}:(shape=#{self.operation.output_shapes[self.index]}, dtype=#{self.operation.output_types[self.index]})" result.join(', ') else super end end |