Sha256: 474b5b6b8f78eff0f4235151c8bafe32caac4ef42a39763d3ff0b43c7d8bfd96

Contents?: true

Size: 505 Bytes

Versions: 9

Compression:

Stored size: 505 Bytes

Contents

module TensorStream
  ##
  # Utiliity functions for creating performance reports
  class ReportTool
    def self.profile_for(session, order_by: :slowest)
      context = session.last_session_context
      eval_times = context[:profile][:operations].map { |name, profile|
        [name, profile[:op], profile[:eval_time], profile[:shape]]
      }

      if order_by == :slowest
        eval_times.sort_by { |a| a[2] }.reverse!
      else
        eval_times.sort_by { |a| a[2] }
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
tensor_stream-1.0.9 lib/tensor_stream/profile/report_tool.rb
tensor_stream-1.0.8 lib/tensor_stream/profile/report_tool.rb
tensor_stream-1.0.7 lib/tensor_stream/profile/report_tool.rb
tensor_stream-1.0.6 lib/tensor_stream/profile/report_tool.rb
tensor_stream-1.0.5 lib/tensor_stream/profile/report_tool.rb
tensor_stream-1.0.4 lib/tensor_stream/profile/report_tool.rb
tensor_stream-1.0.3 lib/tensor_stream/profile/report_tool.rb
tensor_stream-1.0.2 lib/tensor_stream/profile/report_tool.rb
tensor_stream-1.0.1 lib/tensor_stream/profile/report_tool.rb