Artelnics / opennn

OpenNN - Open Neural Networks Library
http://www.opennn.net
GNU Lesser General Public License v3.0
1.12k stars 354 forks source link

operator == : overloaded functions have similar conversions #293

Closed peakpeak-github closed 5 months ago

peakpeak-github commented 5 months ago

Visual Studio 2022: I get the following error error C2666: 'Eigen::TensorBase<Derived,0>::operator ==': overloaded functions have similar conversions on the line marked HERE below in file correlations.cpp, line 1034

Correlation` logistic_correlation_matrix_matrix(const ThreadPoolDevice* thread_pool_device, const Tensor<type, 2>& x, const Tensor<type, 2>& y)
{
    Correlation correlation;
    // Scrub missing values
    pair<Tensor<type,2>, Tensor<type,2>> filtered_matrixes = filter_missing_values_matrix_matrix(x,y);
    Tensor<type,2> x_filtered = filtered_matrixes.first;
    Tensor<type,2> y_filtered = filtered_matrixes.second;
    if(x.dimension(0)  == y.dimension(0) && x.dimension(1)  == y.dimension(1))
    {
        Tensor<bool, 0> are_equal = (x_filtered == y_filtered).all(); // <- HERE
        if(are_equal(0))
        {
            correlation.r = static_cast<type>(1);
            correlation.correlation_type = CorrelationType::Logistic;
            return correlation;
        }
    }
peakpeak-github commented 5 months ago

Works with C++17, not with C++20