Sha256: 6c8ac34ab1a70475b2facb129de048eb4ddaecfecfe3e14f3d13f14def49f240

Contents?: true

Size: 710 Bytes

Versions: 15

Compression:

Stored size: 710 Bytes

Contents

module TensorStream
  module Debugging
    extend TensorStream::OpHelper

    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.collect do |input|
          next if input.nil?
          next input if input.is_a?(Variable)

          if input.is_a?(Tensor) && 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
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
tensor_stream-1.0.0 lib/tensor_stream/debugging/debugging.rb
tensor_stream-1.0.0.pre.rc1 lib/tensor_stream/debugging/debugging.rb
tensor_stream-0.9.10 lib/tensor_stream/debugging/debugging.rb
tensor_stream-0.9.9 lib/tensor_stream/debugging/debugging.rb
tensor_stream-0.9.8 lib/tensor_stream/debugging/debugging.rb
tensor_stream-0.9.7 lib/tensor_stream/debugging/debugging.rb
tensor_stream-0.9.6 lib/tensor_stream/debugging/debugging.rb
tensor_stream-0.9.5 lib/tensor_stream/debugging/debugging.rb
tensor_stream-0.9.2 lib/tensor_stream/debugging/debugging.rb
tensor_stream-0.9.1 lib/tensor_stream/debugging/debugging.rb
tensor_stream-0.9.0 lib/tensor_stream/debugging/debugging.rb
tensor_stream-0.8.6 lib/tensor_stream/debugging/debugging.rb
tensor_stream-0.8.5 lib/tensor_stream/debugging/debugging.rb
tensor_stream-0.8.1 lib/tensor_stream/debugging/debugging.rb
tensor_stream-0.8.0 lib/tensor_stream/debugging/debugging.rb