eaplatanios / tensorflow_scala

TensorFlow API for the Scala Programming Language
http://platanios.org/tensorflow_scala/
Apache License 2.0
937 stars 95 forks source link

Generify data types #3

Closed eaplatanios closed 7 years ago

eaplatanios commented 7 years ago

TensorFlow data types are each associated with a Scala type (e.g., FLOAT64 with Double). It thus may be better to generify the data type trait using the associated Scala type. FLOAT64 would then extend DataType[Double]. The issue that's preventing this from happening right now is that when we create an op output, we obtain the integer field representing its data type from the C API at runtime. It is thus currently impossible to avoid using existential types (i.e., DataType[_]), which makes the use of generic data types redundant.

eaplatanios commented 7 years ago

I'll close this for now since I think that it may be better to not generify the data type classes.