Alibaba-Gemini-Lab / OpenCheetah

189 stars 48 forks source link

Duplicate function definition in "tensor.h #14

Open muou55555 opened 2 years ago

muou55555 commented 2 years ago
typename TTypes<ScalarType, 2>::ConstTensor matrix() const {
    if (dims() != 2) {
      LOG(FATAL) << "matrix() demands 2D shape";
    }
    return typename TTypes<ScalarType, 2>::ConstTensor(data(), shape_.rows(), shape_.cols());
  }

  typename TTypes<ScalarType, 2>::ConstTensor matrix() {
    if (dims() != 2) {
      LOG(FATAL) << "matrix() demands 2D shape";
    }
    return typename TTypes<ScalarType, 2>::Tensor(data(), shape_.rows(), shape_.cols());
  }

The second definition must change to typename TTypes<ScalarType, 2>::Tensor matrix()