@@ -32,7 +32,6 @@ public partial class Tensor
3232
3333 public Tensor ( )
3434 {
35- _isCreatedInGraphMode = ! tf . executing_eagerly ( ) ;
3635 }
3736
3837 /// <summary>
@@ -44,8 +43,6 @@ public unsafe Tensor(SafeTensorHandle handle, bool clone = false)
4443 _handle = handle ;
4544 if ( clone && handle != null )
4645 _handle = TF_NewTensor ( shape , dtype , data : TensorDataPointer . ToPointer ( ) ) ;
47-
48- _isCreatedInGraphMode = ! tf . executing_eagerly ( ) ;
4946 }
5047
5148 /// <summary>
@@ -59,13 +56,11 @@ public unsafe Tensor(SafeTensorHandle handle, bool clone = false)
5956 public unsafe Tensor ( IntPtr data_ptr , Shape shape , TF_DataType dtype )
6057 {
6158 _handle = TF_NewTensor ( shape , dtype , data : data_ptr . ToPointer ( ) ) ;
62- _isCreatedInGraphMode = ! tf . executing_eagerly ( ) ;
6359 }
6460
6561 public unsafe Tensor ( NDArray nd )
6662 {
6763 _handle = TF_NewTensor ( nd . shape , nd . dtype , nd . data . ToPointer ( ) ) ;
68- _isCreatedInGraphMode = ! tf . executing_eagerly ( ) ;
6964 }
7065
7166 #region scala
@@ -107,13 +102,11 @@ public Tensor(Operation op, int value_index, TF_DataType dtype)
107102 _value_index = value_index ;
108103 _override_dtype = dtype ;
109104 _id = ops . uid ( ) ;
110- _isCreatedInGraphMode = ! tf . executing_eagerly ( ) ;
111105 }
112106
113107 protected unsafe void InitTensor ( Shape shape , TF_DataType dtype )
114108 {
115109 _handle = TF_NewTensor ( shape , dtype , null ) ;
116- _isCreatedInGraphMode = ! tf . executing_eagerly ( ) ;
117110 }
118111
119112 protected unsafe void InitTensor ( Shape shape , byte [ ] bytes , TF_DataType dtype )
@@ -122,13 +115,10 @@ protected unsafe void InitTensor(Shape shape, byte[] bytes, TF_DataType dtype)
122115 _handle = StringTensor ( new byte [ ] [ ] { bytes } , Shape . Scalar ) ;
123116 else
124117 _handle = TF_NewTensor ( bytes , shape , dtype ) ;
125- _isCreatedInGraphMode = ! tf . executing_eagerly ( ) ;
126118 }
127119
128120 protected unsafe void InitTensor ( Array array , Shape ? shape = null )
129121 {
130- _isCreatedInGraphMode = ! tf . executing_eagerly ( ) ;
131-
132122 shape = shape ?? array . GetShape ( ) ;
133123 var dtype = array . GetDataType ( ) ;
134124
0 commit comments