Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
  • Loading branch information
skottmckay and edgchen1 authored Jul 20, 2024
1 parent 3bd6db3 commit 9921187
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Status ConvTransposeOpBuilder::AddToModelBuilderImpl([[maybe_unused]] ModelBuild
// const auto output_shape = helper.GetInt64s("output_shape");
// if (output_shape) {
// AddOperationInput(*op, "output_shape", model_builder.AddConstant(op_type, "output_shape", *output_shape));
// // these are required despite the spec saying
// // these are required despite the spec saying otherwise
// AddOperationInput(*op, "pad_type", model_builder.AddScalarConstant(op_type, "pad_type", std::string("valid")));
// std::vector<int64_t> pads(num_spatial_dims * 2, 0);
// AddOperationInput(*op, "pad", model_builder.AddConstant(op_type, "pad", pads));
Expand Down Expand Up @@ -156,7 +156,7 @@ bool ConvTransposeOpBuilder::IsOpSupportedImpl(const Node& node, const OpBuilder
} else if (autopad == AutoPadType::NOTSET) {
// CoreML output is inconsistent if pads are asymmetric.
// CPU works. Other devices don't seem to (at least on macOS).
auto onnx_pads = *helper.GetInt64s("pads"); // 'pads' are requred if auto_pad is NOTSET
auto onnx_pads = *helper.GetInt64s("pads"); // 'pads' are required if auto_pad is NOTSET
const auto pad_value = onnx_pads[0];
if (!std::all_of(onnx_pads.begin() + 1, onnx_pads.end(),
[pad_value](auto value) { return value == pad_value; })) {
Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/coreml/model/model.mm
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ Status GetMLMultiArrayCopyInfo(const MLMultiArray* array, int64_t* num_blocks, i
for (unsigned long i = 1; i <= rank; i++) {
int64_t this_stride = [array.strides[rank - i] longLongValue];
if (this_stride != total_elems) {
// non-contigous if we have to move more than batch_elems for each entry
// non-contiguous if we have to move more than batch_elems for each entry
if (*block_size != 0) {
return ORT_MAKE_STATUS(ONNXRUNTIME, FAIL,
"Multiple non-contiguous dimensions in MLMultiArray are not supported.");
Expand Down

0 comments on commit 9921187

Please sign in to comment.