File tree 1 file changed +3
-7
lines changed
pkg/workloads/cortex/tf_api
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -161,19 +161,15 @@ def create_raw_prediction_request(sample):
161
161
162
162
if util .is_list (value ):
163
163
shape = [len (value )]
164
- for dim in signature_def [signature_key ]["inputs" ][column_name ]["tensorShape" ]["dim" ][
165
- 1 :
166
- ]:
164
+ for dim in signature_def [signature_key ]["inputs" ][column_name ]["tensorShape" ]["dim" ]:
167
165
shape .append (int (dim ["size" ]))
168
166
else :
169
167
shape = [1 ]
170
- value = [ value ]
168
+
171
169
sig_type = signature_def [signature_key ]["inputs" ][column_name ]["dtype" ]
172
170
173
171
try :
174
- tensor_proto = tf .make_tensor_proto (
175
- value , dtype = DTYPE_TO_TF_TYPE [sig_type ], shape = shape
176
- )
172
+ tensor_proto = tf .make_tensor_proto (value , dtype = DTYPE_TO_TF_TYPE [sig_type ])
177
173
prediction_request .inputs [column_name ].CopyFrom (tensor_proto )
178
174
except Exception as e :
179
175
raise UserException (
You can’t perform that action at this time.
0 commit comments