Might make sense to replace all of these with a generic version (untested):
template<class T>typename std::enable_if<std::is_arithmetic<T>::value, T>::typetransform(const tensor&, const T val){ return val;}
Might make sense to replace all of these with a generic version (***untested***):
```
template<class T>
typename std::enable_if<std::is_arithmetic<T>::value, T>::type
transform(const tensor&, const T val)
{
return val;
}
```