How to run FP16 mode without TensorRT?

Hello everyone,

I would like to convert FP32 weight into FP16 weight
and inference by FP16 mode without tensorRT

described my process in the following

1,make a weight traind FP32 mode
2,convert weight to FP16 from FP32

weight_32 = model.get_weights()
weight_16 = []
for x in range(len(weight_32)):
    weight_16.append(weight_32[x].astype(np.float16))
model.set_weights(weight_16)

3,inference by FP16

keras.backend.set_floatx("float16")

But it doesn’t run and shown follow message

>TypeError: Input 'b' of 'MatMul' Op has type float16 that does not match type float32 of argument 'a'.

Can I run such this method?

thanks,

best regards