Skip to content

Commit

Permalink
Fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiago Crepaldi committed Jul 26, 2022
1 parent 3921ca2 commit c5b72eb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
17 changes: 8 additions & 9 deletions onnxruntime/core/graph/contrib_ops/contrib_defs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ void col2imShapeInference(InferenceContext& ctx) {
return;
}

// TODO: Assume image_shape has correct spatial dimensions for next validations
// Assuming image_shape has correct spatial dimensions and reused for next validation steps
// An alternative is get the the number of spatial dimensions as an input
if (ctx.getInputType(1)->tensor_type().shape().dim_size() != 1) {
fail_shape_inference("image_shape tensor must have rank 1.");
Expand Down Expand Up @@ -967,7 +967,7 @@ void col2imShapeInference(InferenceContext& ctx) {
fail_shape_inference("block_shape tensor must have ", n_input_dims, " spatial dimensions.");
}

int block_shape_size = 0;
int64_t block_shape_size = 0;
if (static_cast<int>(block_shape.size()) > 0) {
block_shape_size = 1;
for (const auto& dim : block_shape) {
Expand All @@ -981,20 +981,20 @@ void col2imShapeInference(InferenceContext& ctx) {
// Dimensions N and C are always present
Dim N, C;
if (ctx.getInputType(0)->tensor_type().shape().dim(0).has_dim_value()) {
N = input_shape.dim(0); // Otherwise, N is unknown.
N = input_shape.dim(0); // Otherwise, N is unknown.
}
*final_image_shape->add_dim() = N;

if (block_shape_size > 0) {
C = input_shape.dim(1) / block_shape_size; // Otherwise, C is unknown.
C = input_shape.dim(1) / block_shape_size; // Otherwise, C is unknown.
}
*final_image_shape->add_dim() = C;

// Image dimensions are dynamic
for (size_t i = 0; i < n_input_dims; ++i) {
Dim image_dim_i;
if (image_shape.size() > 0) {
image_dim_i.set_dim_value(image_shape[i]); // Otherwise, spatial dimensions are unknown
image_dim_i.set_dim_value(image_shape[i]); // Otherwise, spatial dimensions are unknown
}
*final_image_shape->add_dim() = image_dim_i;
}
Expand Down Expand Up @@ -1024,8 +1024,8 @@ ONNX_MS_OPERATOR_SET_SCHEMA(Col2Im, 1,
OPTIONAL_VALUE)
.Attr(
"pads",
"1-dimensional tensor with padding value for the beginning and ending along each spatial axis, "
"it can take any value greater than or equal to 0. "
"1-dimensional tensor with padding value for the beginning and ending along each"
" spatial axis, it can take any value greater than or equal to 0. "
"The value represent the number of pixels added to the beginning "
"and end part of the corresponding axis. `pads` format should be as follow "
"[x1_begin, x2_begin...x1_end, x2_end,...], where xi_begin is the number of pixels "
Expand Down Expand Up @@ -1085,8 +1085,7 @@ ONNX_MS_OPERATOR_SET_SCHEMA(Col2Im, 1,
"T",
OpSchema::all_tensor_types_with_bfloat(),
"Constrain input and output types to all numeric tensor types.")
.TypeAndShapeInferenceFunction([](InferenceContext& ctx) { col2imShapeInference(ctx); })
);
.TypeAndShapeInferenceFunction([](InferenceContext& ctx) { col2imShapeInference(ctx); }));

constexpr const char* GridSample_ver1_doc = R"DOC(
Given an `input` and a flow-field `grid`, computes the `output` using `input` values and pixel locations from `grid`.
Expand Down
1 change: 1 addition & 0 deletions onnxruntime/core/providers/cpu/tensor/col2im.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ REGISTER_KERNEL_TYPED(float)

template <typename T>
Status Col2Im<T>::Compute(OpKernelContext* context) const {
(void) context;
return Status::OK();
}

Expand Down
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/cpu/tensor/col2im.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "core/framework/op_kernel.h"
#include "core/util/math_cpuonly.h"
#include "core/framework/tensor.h"
#include "concatbase.h"
#include "core/providers/cpu/tensor/concatbase.h"

namespace onnxruntime {

Expand Down

0 comments on commit c5b72eb

Please sign in to comment.