class Tensorflow::Graph::Function

Attributes

output_shapes[R]
output_types[R]

Public Class Methods

new(pointer, output_types, output_shapes) click to toggle source
# 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

Public Instance Methods

function_def() click to toggle source
# 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() click to toggle source
# File lib/tensorflow/graph/function.rb, line 15
def name
  name, ptr = FFI.TF_FunctionName(self)
  name
end
to_ptr() click to toggle source
# File lib/tensorflow/graph/function.rb, line 11
def to_ptr
  @pointer
end