Skip to content

Tensor type conversion handling

The following discussion from !172 (merged) should be addressed:

The discussion is in two points:

  • When initializing a Tensor from a Scalar to which datatype should we convert ? (currently conversion try to find the best fit datatype int32 -> int64 -> float32 -> float64). Should we force conversion to default datatype to avoid possible information loss when int64 -> float32 ? Or should we always convert to a default dtype (float32 ?).
  • Add an argument dtype in Tensor ctor (for scalar and array initialization) to force the conversion to a specific type.