Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ShigekiKarita committed Dec 24, 2018
1 parent 4ca8bd0 commit eac5587
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,12 @@ matrix:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty
- llvm-toolchain-trusty-7
packages:
- g++-8
- clang-7
- libc++-7-dev
- libc++abi-7-dev
env:
- MATRIX_EVAL="CC=clang-7 && CXX=clang++-7 && CXXFLAGS=-std=libc++"
- MATRIX_EVAL="CC=clang-7 && CXX=clang++-7"

before_install:
- eval "${MATRIX_EVAL}"
Expand Down
2 changes: 1 addition & 1 deletion include/thxx/catch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ namespace Catch{

template <typename T, typename... Rest>
inline constexpr auto is_unique<T, Rest...> = std::bool_constant<
(!std::is_same<T, Rest>::value && ...) && is_unique<Rest...>
(!std::is_same_v<T, Rest> && ...) && is_unique<Rest...>
>{};
#else

Expand Down
2 changes: 1 addition & 1 deletion include/thxx/meta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ namespace thxx {
};

static auto sequential_impl() {
return [](auto&& x) { return x; };
return [](auto&& x) { return std::move(x); }; // avoid copy
}

template <typename A, typename ... Args>
Expand Down
4 changes: 2 additions & 2 deletions include/thxx/testing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace thxx {
return (a == b).all().template item<std::uint8_t>() == 1;
}

virtual std::string describe() const {
virtual std::string describe() const override {
std::ostringstream ss;
ss << "\nis not equal to\n" << a;
return ss.str();
Expand All @@ -39,7 +39,7 @@ namespace thxx {
return ret;
}

virtual std::string describe() const {
virtual std::string describe() const override {
std::ostringstream ss;
ss << "should" << this->s << "have a grad";
return ss.str();
Expand Down
2 changes: 1 addition & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
CXX_FLAGS := $(CXXFLAGS) -std=c++17 -g3 -O0 -pthread -D_GLIBCXX_USE_CXX11_ABI=0 -Wall -Wextra -Wno-unused-function -D_LIBCPP_DEBUG # -D_GLIBCXX_DEBUG
# -ftrapv

INCPATH := $(shell python -c "import torch.utils.cpp_extension as C; print('-isystem' + str.join(' -I', C.include_paths()))")
INCPATH := $(shell python -c "import torch.utils.cpp_extension as C; print('-isystem' + str.join(' -isystem', C.include_paths()))")

LIBPATH := $(shell python -c "import torch.utils.cpp_extension as C; print(C.include_paths()[0] + '/../')")

Expand Down
10 changes: 5 additions & 5 deletions test/test_net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,31 +99,31 @@ TEST_CASE( "transformer", "[net]" ) {
}
{
auto f = T::EncoderLayer(n_input, 3, 4, 0.1);
auto [h, hm] = f->forward(x, m);
auto [h, _hm] = f->forward(x, m);
h.sum().backward();
CHECK_THAT( *f, testing::HasGrad(true) );
}
{
auto f = T::DecoderLayer(n_input, 3, 4, 0.1);
auto [p, pm] = f->forward(y, ym, x, m);
auto [p, _pm] = f->forward(y, ym, x, m);
p.sum().backward();
CHECK_THAT( *f, testing::HasGrad(true) );
}
{
auto f = T::Conv2dSubsampling(n_input, 10, 0.1);
auto [h, hm] = f->forward(x, m);
auto [h, _hm] = f->forward(x, m);
h.sum().backward();
CHECK_THAT( *f, testing::HasGrad(true) );
}
{
auto f = T::Encoder(n_input, conf);
auto [h, hm] = f->forward(x, m);
auto [h, _hm] = f->forward(x, m);
h.sum().backward();
CHECK_THAT( *f, testing::HasGrad(true) );
}
{
auto f = T::Decoder(n_output, conf);
auto [p, pm] = f->forward(t, tm, x, m);
auto [p, _pm] = f->forward(t, tm, x, m);
p.sum().backward();
CHECK_THAT( *f, testing::HasGrad(true) );
}
Expand Down

0 comments on commit eac5587

Please sign in to comment.