Skip to content

Commit

Permalink
Format torch_utils.h
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomengy committed May 7, 2022
1 parent d84380e commit b447a61
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions torchrl/csrc/torch_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,23 @@
namespace torchrl {
namespace utils {

template <typename T> struct TorchDataType;
template <typename T>
struct TorchDataType;

template <> struct TorchDataType<int64_t> {
template <>
struct TorchDataType<int64_t> {
static constexpr torch::ScalarType value = torch::kInt64;
};

template <> struct TorchDataType<float> {
template <>
struct TorchDataType<float> {
static constexpr torch::ScalarType value = torch::kFloat;
};

template <> struct TorchDataType<double> {
template <>
struct TorchDataType<double> {
static constexpr torch::ScalarType value = torch::kDouble;
};

} // namespace utils
} // namespace torchrl
} // namespace utils
} // namespace torchrl

0 comments on commit b447a61

Please sign in to comment.