Class: TensorStream::EvaluatorUtils

Inherits:
Object
  • Object
show all
Extended by:
StringHelper
Defined in:
lib/tensor_stream/evaluator/evaluator_utils.rb

Class Method Summary collapse

Methods included from StringHelper

camelize, constantize, symbolize_keys, underscore

Class Method Details

.get_evaluator_classes(evaluators) ⇒ Object



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

def self.get_evaluator_classes(evaluators)
  @evaluator_classes ||= if evaluators.is_a?(Array)
    if evaluators.empty?
      TensorStream::Evaluator.default_evaluators
    else
      evaluators.collect { |name| Object.const_get("TensorStream::Evaluator::#{camelize(name.to_s)}") }
    end
  elsif evaluators.nil?
    TensorStream::Evaluator.default_evaluators
  else
    [Object.const_get("TensorStream::Evaluator::#{camelize(evaluators.to_s)}")]
  end
  @evaluator_classes
end