mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-15 13:15:57 +08:00
Fix unused variable warnings in TensorIO
This commit is contained in:
parent
4de870b6eb
commit
8cafbc4736
@ -195,19 +195,19 @@ namespace internal {
|
|||||||
// Default scalar printer.
|
// Default scalar printer.
|
||||||
template <typename Scalar, typename Format, typename EnableIf = void>
|
template <typename Scalar, typename Format, typename EnableIf = void>
|
||||||
struct ScalarPrinter {
|
struct ScalarPrinter {
|
||||||
static void run(std::ostream& stream, const Scalar& scalar, const Format& fmt) { stream << scalar; }
|
static void run(std::ostream& stream, const Scalar& scalar, const Format&) { stream << scalar; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Scalar>
|
template <typename Scalar>
|
||||||
struct ScalarPrinter<Scalar, TensorIOFormatNumpy, std::enable_if_t<NumTraits<Scalar>::IsComplex>> {
|
struct ScalarPrinter<Scalar, TensorIOFormatNumpy, std::enable_if_t<NumTraits<Scalar>::IsComplex>> {
|
||||||
static void run(std::ostream& stream, const Scalar& scalar, const TensorIOFormatNumpy& fmt) {
|
static void run(std::ostream& stream, const Scalar& scalar, const TensorIOFormatNumpy&) {
|
||||||
stream << numext::real(scalar) << "+" << numext::imag(scalar) << "j";
|
stream << numext::real(scalar) << "+" << numext::imag(scalar) << "j";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Scalar>
|
template <typename Scalar>
|
||||||
struct ScalarPrinter<Scalar, TensorIOFormatNative, std::enable_if_t<NumTraits<Scalar>::IsComplex>> {
|
struct ScalarPrinter<Scalar, TensorIOFormatNative, std::enable_if_t<NumTraits<Scalar>::IsComplex>> {
|
||||||
static void run(std::ostream& stream, const Scalar& scalar, const TensorIOFormatNative& fmt) {
|
static void run(std::ostream& stream, const Scalar& scalar, const TensorIOFormatNative&) {
|
||||||
stream << "{" << numext::real(scalar) << ", " << numext::imag(scalar) << "}";
|
stream << "{" << numext::real(scalar) << ", " << numext::imag(scalar) << "}";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -339,7 +339,7 @@ struct TensorPrinter {
|
|||||||
IndexType scalar_width = scalar_str.length();
|
IndexType scalar_width = scalar_str.length();
|
||||||
if (width && scalar_width < width) {
|
if (width && scalar_width < width) {
|
||||||
std::string filler;
|
std::string filler;
|
||||||
for (IndexType i = scalar_width; i < width; ++i) {
|
for (IndexType j = scalar_width; j < width; ++j) {
|
||||||
filler.push_back(fmt.fill);
|
filler.push_back(fmt.fill);
|
||||||
}
|
}
|
||||||
s << filler;
|
s << filler;
|
||||||
@ -360,7 +360,7 @@ struct TensorPrinter<Tensor, rank, TensorIOFormatLegacy, std::enable_if_t<rank !
|
|||||||
using Format = TensorIOFormatLegacy;
|
using Format = TensorIOFormatLegacy;
|
||||||
using Scalar = std::remove_const_t<typename Tensor::Scalar>;
|
using Scalar = std::remove_const_t<typename Tensor::Scalar>;
|
||||||
|
|
||||||
static void run(std::ostream& s, const Tensor& tensor, const Format& fmt) {
|
static void run(std::ostream& s, const Tensor& tensor, const Format&) {
|
||||||
typedef typename Tensor::Index IndexType;
|
typedef typename Tensor::Index IndexType;
|
||||||
// backwards compatibility case: print tensor after reshaping to matrix of size dim(0) x
|
// backwards compatibility case: print tensor after reshaping to matrix of size dim(0) x
|
||||||
// (dim(1)*dim(2)*...*dim(rank-1)).
|
// (dim(1)*dim(2)*...*dim(rank-1)).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user