Class: Tensorflow::Graph::Function
- Inherits:
-
Object
- Object
- Tensorflow::Graph::Function
- Defined in:
- lib/tensorflow/graph/function.rb
Instance Attribute Summary collapse
-
#output_shapes ⇒ Object
readonly
Returns the value of attribute output_shapes.
-
#output_types ⇒ Object
readonly
Returns the value of attribute output_types.
Instance Method Summary collapse
- #function_def ⇒ Object
-
#initialize(pointer, output_types, output_shapes) ⇒ Function
constructor
A new instance of Function.
- #name ⇒ Object
- #to_ptr ⇒ Object
Constructor Details
#initialize(pointer, output_types, output_shapes) ⇒ Function
Returns a new instance of Function.
5 6 7 8 9 |
# File 'lib/tensorflow/graph/function.rb', line 5 def initialize(pointer, output_types, output_shapes) @pointer = pointer @output_types = output_types @output_shapes = output_shapes end |
Instance Attribute Details
#output_shapes ⇒ Object (readonly)
Returns the value of attribute output_shapes.
4 5 6 |
# File 'lib/tensorflow/graph/function.rb', line 4 def output_shapes @output_shapes end |
#output_types ⇒ Object (readonly)
Returns the value of attribute output_types.
4 5 6 |
# File 'lib/tensorflow/graph/function.rb', line 4 def output_types @output_types end |
Instance Method Details
#function_def ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/tensorflow/graph/function.rb', line 20 def function_def buffer_ptr = FFI.TF_NewBuffer Status.check do |status| FFI.TF_FunctionToFunctionDef(self, buffer_ptr, status) end buffer = FFI::Buffer.new(buffer_ptr) string = buffer[:data].read_string(buffer[:length]) Tensorflow::FunctionDef.decode(string) ensure FFI.TF_DeleteBuffer(buffer) end |
#name ⇒ Object
15 16 17 18 |
# File 'lib/tensorflow/graph/function.rb', line 15 def name name, ptr = FFI.TF_FunctionName(self) name end |
#to_ptr ⇒ Object
11 12 13 |
# File 'lib/tensorflow/graph/function.rb', line 11 def to_ptr @pointer end |