<commit_before>#pragma once

#include "xchainer/macro.h"

namespace xchainer {

template <typename T>
class ArithmeticOps {
public:
    XCHAINER_HOST_DEVICE static T Add(T lhs, T rhs) { return lhs + rhs; }
    XCHAINER_HOST_DEVICE static T Multiply(T lhs, T rhs) { return lhs * rhs; }
    XCHAINER_HOST_DEVICE static T Divide(T lhs, T rhs) { return lhs / rhs; }
};

template <>
class ArithmeticOps<bool> {
public:
    XCHAINER_HOST_DEVICE static bool Add(bool lhs, bool rhs) { return lhs || rhs; }
    XCHAINER_HOST_DEVICE static bool Multiply(bool lhs, bool rhs) { return lhs && rhs; }
    XCHAINER_HOST_DEVICE static bool Divide(bool lhs, bool rhs) { return lhs && rhs; }
};<commit_msg>Add a TODO comment about boolean division<commit_after>#pragma once

#include "xchainer/macro.h"

namespace xchainer {

template <typename T>
class ArithmeticOps {
public:
    XCHAINER_HOST_DEVICE static T Add(T lhs, T rhs) { return lhs + rhs; }
    XCHAINER_HOST_DEVICE static T Multiply(T lhs, T rhs) { return lhs * rhs; }
    XCHAINER_HOST_DEVICE static T Divide(T lhs, T rhs) { return lhs / rhs; }
};

template <>
class ArithmeticOps<bool> {
public:
    XCHAINER_HOST_DEVICE static bool Add(bool lhs, bool rhs) { return lhs || rhs; }
    XCHAINER_HOST_DEVICE static bool Multiply(bool lhs, bool rhs) { return lhs && rhs; }
    // TODO(beam2d): It's a tentative implementation. Make distinction between TrueDivide and FloorDivide for better NumPy compatibility.
    // The current implementation is of boolean FloorDivide except for warnings.
    XCHAINER_HOST_DEVICE static bool Divide(bool lhs, bool rhs) { return lhs && rhs; }
};
{'fraction_non_alphanumeric': 0.0918052988293284, 'fraction_numerical': 0.0006161429451632779, 'mean_word_length': 4.255663430420712, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1043777', 'n_tokens_mistral': 559, 'n_tokens_neox': 540, 'n_words': 183}