Skip to content
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 kernels/quantized/cpu/op_quantize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ Tensor& quantize_per_channel_out(
check_quantize_per_tensor_args(input, quant_min, quant_max, dtype, out);

// a list contains all dimensions except axis
int64_t dims[input.dim() - 1];
int64_t dims[kTensorDimensionLimit];
for (int64_t i = 0; i < input.dim() - 1; i++) {
if (i < axis) {
dims[i] = i;
Expand Down
7 changes: 5 additions & 2 deletions runtime/core/portable_type/tensor_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ Error TensorImpl::internal_resize_contiguous(ArrayRef<SizesType> new_sizes) {
numel_bound_);

if (strides_ && dim_order_) {
ET_CHECK_OK_OR_RETURN_ERROR(
dim_order_to_stride(new_sizes.data(), dim_order_, dim_, strides_));
auto error =
dim_order_to_stride(new_sizes.data(), dim_order_, dim_, strides_);
if (error != Error::Ok) {
return error;
}
}
numel_ = new_numel;
std::copy(new_sizes.begin(), new_sizes.end(), sizes_);
Expand Down
10 changes: 4 additions & 6 deletions runtime/executor/memory_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,16 @@ class MemoryManager final {
* TODO(T162089316): Remove this once all users migrate to the new ctor.
*/
ET_DEPRECATED MemoryManager(
// We would normally use ET_UNUSED here, but GCC older than 9.3 has a
// bug that triggers a syntax error when using [[maybe_unused]] on the
// first parameter of a constructor:
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81429
__attribute__((unused)) MemoryAllocator* constant_allocator,
MemoryAllocator* constant_allocator,
HierarchicalAllocator* non_constant_allocator,
MemoryAllocator* runtime_allocator,
MemoryAllocator* temporary_allocator)
: MemoryManager(
/*method_allocator=*/runtime_allocator,
/*planned_memory=*/non_constant_allocator,
/*temp_allocator=*/temporary_allocator) {}
/*temp_allocator=*/temporary_allocator) {
(void)constant_allocator; // Suppress unused variable warning
}

/**
* Returns the allocator that the runtime will use to allocate internal
Expand Down
6 changes: 5 additions & 1 deletion runtime/executor/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ Result<executorch_flatbuffer::ExecutionPlan*> get_execution_plan(
} else if (eh.error() == Error::NotFound) {
// No header; the program consumes the whole file, and there are no
// segments.
program_size = ET_UNWRAP(loader->size());
auto result = loader->size();
if (!result.ok()) {
return result.error();
}
program_size = result.get();
} else {
ET_LOG(Error, "Extended header may be corrupt");
return eh.error();
Expand Down
Loading