File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,18 @@ Result<BufferCleanup> prepare_input_tensors(Method& method) {
23
23
void ** inputs = (void **)malloc (num_inputs * sizeof (void *));
24
24
25
25
for (size_t i = 0 ; i < num_inputs; i++) {
26
- Result<TensorInfo> tensor_meta = method_meta.input_tensor_meta (i);
27
- if (!tensor_meta.ok ()) {
26
+ auto tag = method_meta.input_tag (i);
27
+ if (!tag.ok ()) {
28
+ return tag.error ();
29
+ }
30
+ if (tag.get () != Tag::Tensor) {
28
31
ET_LOG (Info, " Skipping non-tensor input %zu" , i);
29
32
continue ;
30
33
}
34
+ Result<TensorInfo> tensor_meta = method_meta.input_tensor_meta (i);
35
+ if (!tensor_meta.ok ()) {
36
+ return tensor_meta.error ();
37
+ }
31
38
// This input is a tensor. Allocate a buffer for it.
32
39
void * data_ptr = malloc (tensor_meta->nbytes ());
33
40
inputs[num_allocated++] = data_ptr;
You can’t perform that action at this time.
0 commit comments