Fix scaler->scalar typo. (#4142)

This commit is contained in:
Sergii Dymchenko 2020-06-08 13:02:12 -07:00 committed by GitHub
parent 6bbd18efd0
commit 653417ae4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -971,7 +971,8 @@ class ORTTrainer():
model.graph.output[0].type.tensor_type.elem_type != onnx.TensorProto().BFLOAT16:
raise RuntimeError("the first output of a model to run with fully optimized ORT backend must be float types.")
if len(model.graph.output[0].type.tensor_type.shape.dim) != 0:
raise RuntimeError("the first output of a model to run with fully optimized ORT backend must be a scaler.")
raise RuntimeError(
"the first output of a model to run with fully optimized ORT backend assumed to be loss and must be a scalar.")
class LossScaler():
def __init__(self, loss_scale_input_name, is_dynamic_scale,