Skip to content

Commit

Permalink
Bug fix: exception need throw
Browse files Browse the repository at this point in the history
  • Loading branch information
feiyun0112 committed May 29, 2021
1 parent 7c34ab9 commit 26b348e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Microsoft.ML.TensorFlow/TensorflowTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ internal static (TF_DataType[] tfInputTypes, TensorShape[] tfInputShapes, (Opera
internal static TensorShape GetTensorShape(TF_Output output, Graph graph, Status status = null)
{
if (graph == IntPtr.Zero)
new ObjectDisposedException(nameof(graph));
throw new ObjectDisposedException(nameof(graph));

var cstatus = status == null ? new Status() : status;
var n = c_api.TF_GraphGetTensorNumDims(graph, output, cstatus.Handle);
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.TensorFlow/TensorflowUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ public static TF_Output ParseOutput(Session session, string operation)
public Tensor[] Run()
{
if (_session == IntPtr.Zero)
new ObjectDisposedException(nameof(_session));
throw new ObjectDisposedException(nameof(_session));

unsafe
{
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.ML.Vision/DnnRetrainTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ internal static (TF_DataType[] tfInputTypes, TensorShape[] tfInputShapes, (Opera
internal static TensorShape GetTensorShape(TF_Output output, Graph graph, Status status = null)
{
if (graph == IntPtr.Zero)
new ObjectDisposedException(nameof(graph));
throw new ObjectDisposedException(nameof(graph));

var cstatus = status == null ? new Status() : status;
var n = c_api.TF_GraphGetTensorNumDims(graph, output, cstatus.Handle);
Expand Down

0 comments on commit 26b348e

Please sign in to comment.