Skip to content

Commit 7a2934b

Browse files
committed
Revert "Add SupportedTensorDtypes::BOOL (#9584)"
This reverts commit 9123e91.
1 parent 20d31fa commit 7a2934b

File tree

2 files changed

+1
-31
lines changed

2 files changed

+1
-31
lines changed

kernels/portable/cpu/util/dtype_util.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ bool check_tensor_dtype(
2727
return executorch::runtime::tensor_is_floating_type(t);
2828
case SupportedTensorDtypes::INTB:
2929
return executorch::runtime::tensor_is_integral_type(t, true);
30-
case SupportedTensorDtypes::BOOL:
31-
return executorch::runtime::tensor_is_type(t, ScalarType::Bool);
3230
case SupportedTensorDtypes::BOOL_OR_BYTE:
3331
return (executorch::runtime::tensor_is_type(
3432
t, ScalarType::Bool, ScalarType::Byte));

kernels/portable/cpu/util/dtype_util.h

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,6 @@ load_to_compute_fn<CTYPE_COMPUTE> get_load_to_compute_fn_intb(const Tensor& t) {
7272
return result;
7373
}
7474

75-
template <typename CTYPE_COMPUTE, const char* op_name>
76-
load_to_compute_fn<CTYPE_COMPUTE> get_load_to_compute_fn_bool(const Tensor& t) {
77-
ET_CHECK_MSG(
78-
t.scalar_type() == ScalarType::Bool,
79-
"Unhandled dtype %s for %s",
80-
::executorch::runtime::toString(t.scalar_type()),
81-
op_name);
82-
return internal::load_and_convert<CTYPE_COMPUTE, bool>;
83-
}
84-
8575
template <typename CTYPE_COMPUTE, const char* op_name>
8676
load_to_compute_fn<CTYPE_COMPUTE> get_load_to_compute_fn_bool_or_byte(
8777
const Tensor& t) {
@@ -175,17 +165,6 @@ store_compute_to_tensor_fn<CTYPE_COMPUTE> get_store_compute_to_tensor_fn_intb(
175165
return result;
176166
}
177167

178-
template <typename CTYPE_COMPUTE, const char* op_name>
179-
store_compute_to_tensor_fn<CTYPE_COMPUTE> get_store_compute_to_tensor_fn_bool(
180-
const Tensor& t) {
181-
ET_CHECK_MSG(
182-
t.scalar_type() == ScalarType::Bool,
183-
"Unhandled dtype %s for %s",
184-
::executorch::runtime::toString(t.scalar_type()),
185-
op_name);
186-
return internal::convert_and_store<bool, CTYPE_COMPUTE>;
187-
}
188-
189168
template <typename CTYPE_COMPUTE, const char* op_name>
190169
store_compute_to_tensor_fn<CTYPE_COMPUTE>
191170
get_store_compute_to_tensor_fn_bool_or_byte(const Tensor& t) {
@@ -240,7 +219,6 @@ enum class SupportedTensorDtypes {
240219
REALHBF16,
241220
FLOATHBF16,
242221
INTB,
243-
BOOL,
244222
BOOL_OR_BYTE,
245223
// DEPRECATED: not likely to be correct; use SAME_AS_COMMON.
246224
SAME_AS_COMPUTE,
@@ -262,8 +240,6 @@ load_to_compute_fn<CTYPE_COMPUTE> get_load_to_compute_fn_impl(
262240
return get_load_to_compute_fn_realhbf16<CTYPE_COMPUTE, op_name>(t);
263241
case SupportedTensorDtypes::INTB:
264242
return get_load_to_compute_fn_intb<CTYPE_COMPUTE, op_name>(t);
265-
case SupportedTensorDtypes::BOOL:
266-
return get_load_to_compute_fn_bool<CTYPE_COMPUTE, op_name>(t);
267243
case SupportedTensorDtypes::BOOL_OR_BYTE:
268244
return get_load_to_compute_fn_bool_or_byte<CTYPE_COMPUTE, op_name>(t);
269245
case SupportedTensorDtypes::SAME_AS_COMPUTE:
@@ -295,8 +271,6 @@ store_compute_to_tensor_fn<CTYPE_COMPUTE> get_store_compute_to_tensor_fn(
295271
t);
296272
case SupportedTensorDtypes::INTB:
297273
return get_store_compute_to_tensor_fn_intb<CTYPE_COMPUTE, op_name>(t);
298-
case SupportedTensorDtypes::BOOL:
299-
return get_store_compute_to_tensor_fn_bool<CTYPE_COMPUTE, op_name>(t);
300274
case SupportedTensorDtypes::BOOL_OR_BYTE:
301275
return get_store_compute_to_tensor_fn_bool_or_byte<
302276
CTYPE_COMPUTE,
@@ -344,14 +318,12 @@ bool check_tensor_dtype(
344318
const ScalarType compute_type);
345319

346320
/// Return the one output type we are willing to emit specialized code
347-
/// to handle, given a compute type of CTYPE_COMPUTE and supported
321+
/// to handle, given a compute type of CTYPE_COMMON and supported
348322
/// output types of out_dtypes.
349323
template <typename CTYPE_COMPUTE>
350324
inline constexpr ScalarType specialized_output_scalar_type(
351325
SupportedTensorDtypes out_dtypes) {
352326
switch (out_dtypes) {
353-
case SupportedTensorDtypes::BOOL:
354-
return ScalarType::Bool;
355327
case SupportedTensorDtypes::BOOL_OR_BYTE:
356328
return ScalarType::Bool;
357329
case SupportedTensorDtypes::REALHBBF16:

0 commit comments

Comments
 (0)