def set_many_constants(self, tensors: Dict[str, AITData]):
        """
        Bulk set many constants at once. More efficient than set_constant()
        since it only has to acquire the lock once.
        """
        c_names = (ctypes.c_char_p * len(tensors))()
        c_tensors = (_CFormatAITData * len(tensors))()
        ait_tensors = {
            name.encode("utf-8"): self._convert_single_param_to_c_format(tensor)
            for name, tensor in tensors.items()
        }
        for i, (name_bytes, tensor) in enumerate(ait_tensors.items()):
            c_names[i] = ctypes.c_char_p(name_bytes)
            c_tensors[i] = tensor

        num_tensors = ctypes.c_size_t(len(tensors))
        self.DLL.AITemplateModelContainerSetManyConstants(
            self.handle, c_names, c_tensors, num_tensors
        )

        Bulk set many constants at once. More efficient than set_constant()
        since it only has to acquire the lock once.
        
python/aitemplate/compiler/model.py