Hi,
Yes this can be done in a model.
Be carefull though that the gradients for this op wrt b will be 0 everywhere and so you won’t be able to train anything with them. But the gradients for a will be exactly what you expect.