Skip to content

Commit 88fb5ee

Browse files
malfetfacebook-github-bot
authored andcommitted
Revert D28819779: [TensorExpr] Improve debug messages.
Test Plan: revert-hammer Differential Revision: D28819779 Original commit changeset: 2eaa0b78fb30 fbshipit-source-id: babc22f75d87b1ba25f78ffe59266560413778ce
1 parent aa66990 commit 88fb5ee

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

torch/csrc/jit/tensorexpr/kernel.cpp

+10-14
Original file line numberDiff line numberDiff line change
@@ -195,37 +195,37 @@ bool conv2dIsSupported(
195195
if (input.dtype != c10::ScalarType::Float ||
196196
weight.dtype != c10::ScalarType::Float ||
197197
bias.dtype != c10::ScalarType::Float) {
198-
GRAPH_DEBUG("conv2dIsSupported: only float32 allowed");
198+
GRAPH_DEBUG("only float32 allowed");
199199
return false;
200200
}
201201
if (input.dims.size() != 4 || weight.dims.size() != 4 ||
202202
bias.dims.size() != 1) {
203-
GRAPH_DEBUG("conv2dIsSupported: inputs are the wrong size");
203+
GRAPH_DEBUG("inputs are the wrong size");
204204
return false;
205205
}
206206
auto Cin = input.dims[1];
207207
auto Cout = weight.dims[0];
208208
auto CperG = weight.dims[1];
209209
if (Cin != Cout || Cin != groups || CperG != 1) {
210-
GRAPH_DEBUG("conv2dIsSupported: not depthwise");
210+
GRAPH_DEBUG("not depthwise");
211211
return false;
212212
}
213213
auto KH = weight.dims[2];
214214
auto KW = weight.dims[3];
215215
if (KH != 3 || KW != 3) {
216-
GRAPH_DEBUG("conv2dIsSupported: not 3x3");
216+
GRAPH_DEBUG("not 3x3");
217217
return false;
218218
}
219219
if (stride.size() != 2 || stride[0] != stride[1]) {
220-
GRAPH_DEBUG("conv2dIsSupported: unsupported stride");
220+
GRAPH_DEBUG("unsupported stride");
221221
return false;
222222
}
223223
if (pad.size() != 2 || pad[0] != pad[1]) {
224-
GRAPH_DEBUG("conv2dIsSupported: unsupported pad");
224+
GRAPH_DEBUG("unsupported pad");
225225
return false;
226226
}
227227
if (dilation.size() != 2 || dilation[0] != 1 || dilation[1] != 1) {
228-
GRAPH_DEBUG("conv2dIsSupported: unsupported dilation");
228+
GRAPH_DEBUG("unsupported dilation");
229229
return false;
230230
}
231231
return true;
@@ -720,10 +720,7 @@ std::vector<ExprHandle> TensorExprKernel::inferSizesForValue(
720720
default: {
721721
GRAPH_DEBUG("Can't infer sizes for the node: ", *v->node());
722722
GRAPH_DEBUG("Full fusion group graph:\n", *v->node()->owningGraph());
723-
std::string msg =
724-
std::string("Unhandled node kind (in inferSizesForValue): ") +
725-
v->node()->kind().toQualString();
726-
throw malformed_input(msg);
723+
throw std::runtime_error("Unhandled node kind");
727724
}
728725
}
729726
}
@@ -2672,8 +2669,7 @@ Tensor* tensorexpr::computeOperandValue(
26722669
} break;
26732670
default: {
26742671
std::string msg =
2675-
std::string("Unhandled node kind (in computeOperandValue): ") +
2676-
op.toQualString();
2672+
std::string("Unhandled node kind: ") + op.toQualString();
26772673
throw malformed_input(msg);
26782674
}
26792675
}
@@ -2821,7 +2817,7 @@ Tensor* TensorExprKernel::computeValue(const torch::jit::Value* v) {
28212817
} break;
28222818

28232819
default: {
2824-
std::string msg = std::string("Unhandled node kind (in computeValue): ") +
2820+
std::string msg = std::string("Unhandled node kind: ") +
28252821
v->node()->kind().toQualString();
28262822
throw malformed_input(msg);
28272823
}

0 commit comments

Comments
 (0)