| 70 | using ShapeType = typename ExecType::ShapeType; |
| 71 | |
| 72 | static Result<std::shared_ptr<ArrayData>> Exec( |
| 73 | KernelContext* ctx, const ShapeType& indices, int64_t input_length, |
| 74 | const std::shared_ptr<DataType>& input_type) { |
| 75 | const auto& options = InversePermutationState::Get(ctx); |
| 76 | |
| 77 | // Apply default options semantics. |
| 78 | int64_t output_length = options.max_index < 0 ? input_length : options.max_index + 1; |
| 79 | std::shared_ptr<DataType> output_type = options.output_type.value_or(input_type); |
| 80 | |
| 81 | ThisType impl(ctx, indices, input_length, output_length); |
| 82 | RETURN_NOT_OK(VisitTypeInline(*output_type, &impl)); |
| 83 | |
| 84 | return ArrayData::Make(std::move(output_type), output_length, |
| 85 | {std::move(impl.validity_buf_), std::move(impl.data_buf_)}); |
| 86 | } |
| 87 | |
| 88 | template <typename Type> |
| 89 | enable_if_t<is_integer_type<Type>::value, Status> Visit(const Type& output_type) { |
nothing calls this directly
no test coverage detected