def set_constant(self, name: str, tensor: AITData):
        """
        Set a constant. All constants must have values before calling run().

        Note that the pointer inside tensor must be valid for the entire
        duration of run().
        """
        b_name = name.encode("utf-8")
        c_name = ctypes.c_char_p(b_name)
        c_tensor = self._convert_single_param_to_c_format(tensor)
        self.DLL.AITemplateModelContainerSetConstant(
            self.handle, c_name, ctypes.byref(c_tensor)
        )

        Set a constant. All constants must have values before calling run().

        Note that the pointer inside tensor must be valid for the entire
        duration of run().
        
python/aitemplate/compiler/model.py