Beispiel #1
0
 def toStringOrTFTensor(value):
     if isinstance(value, tf.Tensor):
         return value
     else:
         try:
             return TypeConverters.toString(value)
         except TypeError:
             raise TypeError("Could not convert %s to tensorflow.Tensor or str" % type(value))
Beispiel #2
0
 def toStringOrTFTensor(value):
     if isinstance(value, tf.Tensor):
         return value
     else:
         try:
             return TypeConverters.toString(value)
         except TypeError:
             raise TypeError(
                 "Could not convert %s to tensorflow.Tensor or str" %
                 type(value))
Beispiel #3
0
 def convert(value):
     if value is None:
         raise TypeError("None is not allowed.")
     else:
         return TypeConverters.toString(value)
Beispiel #4
0
 def convert(value):
     if value is None:
         return None
     else:
         return TypeConverters.toString(value)
Beispiel #5
0
 def convert(value):
     package = getattr(_jvm().ai.h2o.sparkling.ml.params, "H2OAlgoParamsHelper$")
     return package.__getattr__("MODULE$").getValidatedEnumValue(enumClass, TypeConverters.toString(value))
def _tensor_name(tensor):
    if isinstance(tensor, tf.Tensor):
        return _tensor_name(tensor.name)
    return TypeConverters.toString(tensor)