Module: TensorStream::Debugging

Extended by:
OpHelper
Included in:
TensorStream
Defined in:
lib/tensor_stream/debugging/debugging.rb

Instance Method Summary collapse

Methods included from OpHelper

_op, cons, dtype_eval, format_source, fp_type?, i_cons, i_op, shape_eval, val_to_dtype

Instance Method Details

#add_check_numerics_opsObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/tensor_stream/debugging/debugging.rb', line 5

def add_check_numerics_ops
  graph = TensorStream.get_default_graph
  nodes_to_process  = graph.nodes.values.select { |node| node.is_a?(Operation) }

  nodes_to_process.each do |node|
    node.inputs = node.inputs.compact.collect do |input|
      if TensorStream::Ops::FLOATING_POINT_TYPES.include?(input.data_type)
        TensorStream.check_numerics(input, "#{node.name}/#{input.name}", name: "check/#{node.name}/#{input.name}" )
      else
        input
      end
    end
  end
end