diff --git a/source/om.js b/source/om.js index 7d46840f51..92ecbe50ea 100644 --- a/source/om.js +++ b/source/om.js @@ -505,7 +505,7 @@ om.Utility = class { } static tensorType(desc) { - if (desc.shape && Array.isArray(desc.shape.dim)) { + if (desc && desc.shape && Array.isArray(desc.shape.dim)) { const dataType = desc && desc.dtype ? om.Utility.dtype(desc.dtype) : '?'; const shape = new om.TensorShape(desc.shape.dim); return new om.TensorType(dataType, shape, desc.layout);