def check_program(self, program):
    quantized_ops = set()
    for block in program.blocks:
        for op in block.ops:
            if (op.type in self.quantizable_op_and_inputs):
                for arg_name in op.input_arg_names:
                    self.assertTrue(arg_name.endswith('.quantized.dequantized'))
                    quantized_ops.add(arg_name)
        for op in block.ops:
            if (op.type in self.quantizable_grad_op_inputs):
                for pname in self.quantizable_grad_op_inputs[op.type]:
                    arg_name = op.input(pname)[0]
                    self.assertTrue(arg_name.endswith('.quantized.dequantized'))
                    self.assertTrue((arg_name in quantized_ops))
def check_program(self, program):
    quantized_ops = set()
    for block in program.blocks:
        for op in block.ops:
            if (op.type in self.quantizable_op_and_inputs):
                for arg_name in op.input_arg_names:
                    self.assertTrue(arg_name.endswith('.quantized.dequantized'))
                    quantized_ops.add(arg_name)
        for op in block.ops:
            if (op.type in self.quantizable_grad_op_inputs):
                for pname in self.quantizable_grad_op_inputs[op.type]:
                    arg_name = op.input(pname)[0]
                    self.assertTrue(arg_name.endswith('.quantized.dequantized'))
                    self.assertTrue((arg_name in quantized_ops))