Hi @ptrblck I completely solved the problem. I sigmoided the input to the function, indeed the input is intended to be in [0, 1] range. At any rate, even with this mistake in place, still the error makes no sense and is unpredictable. On CPU you never see such a thing.
Thank you for your time.