Skip to content
This repository was archived by the owner on Dec 28, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ before_install:
- wget -O cmake.sh https://cmake.org/files/v3.10/cmake-3.10.0-rc1-Linux-x86_64.sh
- sudo sh cmake.sh --skip-license --exclude-subdir --prefix=/usr/local
# Install libtorch
- wget https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-1.3.0%2Bcpu.zip -O /tmp/libtorch.zip
- wget https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-1.4.0%2Bcpu.zip -O /tmp/libtorch.zip
- unzip /tmp/libtorch.zip -d /tmp/
# Install cppcheck
- git clone https://github.com/danmar/cppcheck /tmp/cppcheck && cd /tmp/cppcheck && git checkout 1.87 && cd -
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ before_build:
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
- git submodule update --init --recursive
# Install libtorch
- curl -fsS -o libtorch.zip https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-1.3.0.zip
- curl -fsS -o libtorch.zip https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-1.4.0.zip
- 7z x libtorch.zip -y -oC:\
- set PATH=C:\libtorch\lib;%PATH%
# Run CMake
Expand Down
6 changes: 3 additions & 3 deletions src/distributions/bernoulli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ Bernoulli::Bernoulli(const torch::Tensor *probs,

torch::Tensor Bernoulli::entropy()
{
return torch::binary_cross_entropy_with_logits(logits, probs, torch::Tensor(), torch::Tensor(), Reduction::None);
return torch::binary_cross_entropy_with_logits(logits, probs, torch::Tensor(), torch::Tensor(), torch::Reduction::None);
}

torch::Tensor Bernoulli::log_prob(torch::Tensor value)
{
auto broadcasted_tensors = torch::broadcast_tensors({logits, value});
return -torch::binary_cross_entropy_with_logits(broadcasted_tensors[0], broadcasted_tensors[1], torch::Tensor(), torch::Tensor(), Reduction::None);
return -torch::binary_cross_entropy_with_logits(broadcasted_tensors[0], broadcasted_tensors[1], torch::Tensor(), torch::Tensor(), torch::Reduction::None);
}

torch::Tensor Bernoulli::sample(c10::ArrayRef<int64_t> sample_shape)
Expand Down Expand Up @@ -163,4 +163,4 @@ TEST_CASE("Bernoulli")
}
}
}
}
}