Commit a552f517 authored by Pavel KORSHUNOV's avatar Pavel KORSHUNOV

allow blocks of features in tf evaluation

parent 5b428b7c
...@@ -197,9 +197,19 @@ class TensorflowEval(Algorithm): ...@@ -197,9 +197,19 @@ class TensorflowEval(Algorithm):
""" """
if len(feature) > 0: if len(feature) > 0:
feature = numpy.cast['float32'](feature) # if we have a set of independent blocks to process
self._check_feature(feature) # collect all projections and flatten them in one output array
return self.project_feature(feature) if isinstance(feature, list):
projections = []
for feat in feature:
feat = numpy.cast['float32'](feat)
self._check_feature(feat)
projections.extend(self.project_feature(feat))
return numpy.asarray(projections, dtype=numpy.float32)
else:
feature = numpy.cast['float32'](feature)
self._check_feature(feature)
return self.project_feature(feature)
else: else:
return numpy.zeros(1, dtype=numpy.float64) return numpy.zeros(1, dtype=numpy.float64)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment