'Cannot convert lambda expression to inteded delegate type

I'm trying to update a field in a mongodb database, but I'm getting the following error:

Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type

I use the following function:

List<Items> items= _pat.Find(s => s.Token == data[0]).ToList();

_logs.UpdateOneAsync(s => s.item_id == items[0].item_id
    && s.Date == DateTime.Parse(data[1]),
    s => s.Status = data[2]);

But at the update part of the function, at s => s.Status = data[2], I get the error.

How would I update s.Status if not via this way?

UpdateOneAsync is defined as:

Task<UpdateResult> UpdateOneAsync(FilterDefinition<TDocument> filter, 
    UpdateDefinition<TDocument> update, UpdateOptions options = null,
    CancellationToken cancellationToken = default(CancellationToken));


Solution 1:[1]

It loos lke the output of the model(x) (as defined by model = torch.hub...) has shape 1 x 384, but your linear_classifier expects something of shape _ x 1536 which is why you'll get this error. So you can just adjust that number of inputs by setting

linear_classifier = LinearClassifier(384, 1000)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 flawr