Skip to content

Commit e25fa64

Browse files
Update to PyTorch 1.4 (Omegastick#24)
1 parent 008b10f commit e25fa64

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Diff for: .travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ before_install:
2020
- wget -O cmake.sh https://cmake.org/files/v3.10/cmake-3.10.0-rc1-Linux-x86_64.sh
2121
- sudo sh cmake.sh --skip-license --exclude-subdir --prefix=/usr/local
2222
# Install libtorch
23-
- wget https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-1.3.0%2Bcpu.zip -O /tmp/libtorch.zip
23+
- wget https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-1.4.0%2Bcpu.zip -O /tmp/libtorch.zip
2424
- unzip /tmp/libtorch.zip -d /tmp/
2525
# Install cppcheck
2626
- git clone https://github.com/danmar/cppcheck /tmp/cppcheck && cd /tmp/cppcheck && git checkout 1.87 && cd -

Diff for: appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ before_build:
1313
- sed -i 's/[email protected]:/https:\/\/github.com\//' .gitmodules
1414
- git submodule update --init --recursive
1515
# Install libtorch
16-
- curl -fsS -o libtorch.zip https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-1.3.0.zip
16+
- curl -fsS -o libtorch.zip https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-1.4.0.zip
1717
- 7z x libtorch.zip -y -oC:\
1818
- set PATH=C:\libtorch\lib;%PATH%
1919
# Run CMake

Diff for: src/distributions/bernoulli.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ Bernoulli::Bernoulli(const torch::Tensor *probs,
4343

4444
torch::Tensor Bernoulli::entropy()
4545
{
46-
return torch::binary_cross_entropy_with_logits(logits, probs, torch::Tensor(), torch::Tensor(), Reduction::None);
46+
return torch::binary_cross_entropy_with_logits(logits, probs, torch::Tensor(), torch::Tensor(), torch::Reduction::None);
4747
}
4848

4949
torch::Tensor Bernoulli::log_prob(torch::Tensor value)
5050
{
5151
auto broadcasted_tensors = torch::broadcast_tensors({logits, value});
52-
return -torch::binary_cross_entropy_with_logits(broadcasted_tensors[0], broadcasted_tensors[1], torch::Tensor(), torch::Tensor(), Reduction::None);
52+
return -torch::binary_cross_entropy_with_logits(broadcasted_tensors[0], broadcasted_tensors[1], torch::Tensor(), torch::Tensor(), torch::Reduction::None);
5353
}
5454

5555
torch::Tensor Bernoulli::sample(c10::ArrayRef<int64_t> sample_shape)
@@ -163,4 +163,4 @@ TEST_CASE("Bernoulli")
163163
}
164164
}
165165
}
166-
}
166+
}

0 commit comments

Comments
 (0)