When using the Keras UpSampling2D layer to resize a float64 array the result is cast to float32. The following code snippet demonstrates this behavior.
import numpy as np
from keras import layers
arr = np.ones((4,4), np.float64).reshape((1,4,4,1))
print(arr.dtype) # float64
upsample = layers.UpSampling2D(interpolation='bilinear')
arr_upsampled = upsample(arr)
print(arr_upsampled.dtype) # float32
Why is this happening, and is it possible to keep the resulting tensor float64?