def create_file_value(self, var: Var) -> proto.MIL_pb2.Value:
        """
        Returns the mil proto file value of a var.
        If weight_id is in self.weight_id_to_file_value, we return the value.
        """

        def create_file_value_helper():
            weight_path = self.get_weight_path(var.op)
            blob_writer = self.get_blob_writer(weight_path)
            offset = helper._get_offset_by_writing_data(var, blob_writer)
            weight_file_name = os.path.basename(weight_path)

            # Get proto type for the primitive
            if hasattr(var.sym_type, "get_primitive"):   #  tensor
                primitive = var.sym_type.get_primitive()
            else:   #  scalar
                primitive = var.sym_type
            proto_primitive = types_to_proto_primitive(primitive)

            return create_file_value_tensor(
                file_name=os.path.join(
                    os.path.join("@model_path", _WEIGHTS_DIR_NAME), weight_file_name
                ),
                offset=offset,
                dim=var.val.shape,
                data_type=proto_primitive,
            )

        # use the cached file value
        weight_id = var.op.weight_id
        if weight_id is None:
            # The weight_id is only for const across functions.
            # For caching vars within a function, we use block (function) name + var name.
            weight_id = f"{var.op.enclosing_block.name}_{var.name}"

        if weight_id in self.weight_id_to_file_value:
            assert weight_id is not None, "invalid weight_id"
            return self.weight_id_to_file_value[weight_id]

        file_value = create_file_value_helper()
        self.weight_id_to_file_value[weight_id] = file_value

        return file_value

        Returns the mil proto file value of a var.
        If weight_id is in self.weight_id_to_file_value, we return the value.
        
coremltools/converters/mil/backend/mil/load.py