Method and system for quantizing a neural networkпатент