    def generate_source(self) -> Dict[str, str]:
        """
        Perform the codegen after adding all tensors.
        The dictionary returned is a map from filename -> contents.
        """
        device_functions_header_name = f"{self.target.name()}_device_functions.h"
        result = {}
        result["device_functions-generated.h"] = (
            f'#include "{device_functions_header_name}"'
        )

        result["model-generated.h"] = self.generate_model()

        model_container_src_fname = f"model_container_base{self.target.src_extension()}"

        model_container_base_src = MODEL_CONTAINER_TEMPLATE.render(
            num_inputs=self.num_inputs,
            num_outputs=self.num_outputs,
            param_size=self.max_constant_blob_size + self.extra_owned_constant_size,
            set_up_constant_names="\n".join(self.set_up_constant_names),
            set_up_constant_original_names="\n".join(
                self.set_up_constant_original_names
            ),
            set_up_param_dtypes="\n".join(self.set_up_param_dtypes),
            set_up_bound_constant_dtypes="\n".join(self.set_up_bound_constant_dtypes),
            set_up_bound_constant_size="\n".join(self.set_up_bound_constant_size),
            set_up_output_shapes="\n".join(self.set_up_output_shapes),
            set_up_param_names="\n".join(self.set_up_param_names),
            num_constants=self.num_constants,
            num_bound_constants=self.bound_constant_idx,
            num_unbound_constants=self.unbound_constant_idx,
            owned_constants_init=",".join(self.owned_constants_init),
            set_up_constant_offsets=self._create_set_up_constant_offsets(),
            set_up_constant_folding_inputs="\n".join(
                self.set_up_constant_folding_inputs
            ),
            # # todo: enable once this feature is fully available
            # is_windows=is_windows(),
        )
        result[model_container_src_fname] = model_container_base_src
        return result
Perform the codegen after adding all tensors.
The dictionary returned is a map from filename -> contents.
python/aitemplate/backend/codegen.py