Skip to content

Commit ba49010

Browse files
committed
clean code.
1 parent 1958036 commit ba49010

432 files changed

Lines changed: 3611 additions & 4460 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/TensorFlowNET.Core/APIs/c_api.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public struct DeallocatorArgs
6363

6464
static unsafe DeallocatorArgs()
6565
{
66-
Empty = new IntPtr(EmptyPtr = (DeallocatorArgs*) Marshal.AllocHGlobal(Marshal.SizeOf<DeallocatorArgs>()));
67-
*EmptyPtr = new DeallocatorArgs() {gc_handle = IntPtr.Zero, deallocator_called = false};
66+
Empty = new IntPtr(EmptyPtr = (DeallocatorArgs*)Marshal.AllocHGlobal(Marshal.SizeOf<DeallocatorArgs>()));
67+
*EmptyPtr = new DeallocatorArgs() { gc_handle = IntPtr.Zero, deallocator_called = false };
6868
}
6969

7070
public bool deallocator_called;

src/TensorFlowNET.Core/APIs/tf.array.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ limitations under the License.
1515
******************************************************************************/
1616

1717
using NumSharp;
18-
using System;
1918
using System.Collections.Generic;
2019
using System.Diagnostics;
2120
using System.Linq;

src/TensorFlowNET.Core/APIs/tf.autograph.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ limitations under the License.
1515
******************************************************************************/
1616

1717
using Tensorflow.Graphs;
18-
using Tensorflow.Operations;
1918

2019
namespace Tensorflow
2120
{

src/TensorFlowNET.Core/APIs/tf.compat.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ You may obtain a copy of the License at
1414
limitations under the License.
1515
******************************************************************************/
1616

17-
using NumSharp;
18-
1917
namespace Tensorflow
2018
{
2119
public partial class tensorflow

src/TensorFlowNET.Core/APIs/tf.compat.v1.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ You may obtain a copy of the License at
1414
limitations under the License.
1515
******************************************************************************/
1616

17-
using System;
1817
using System.Collections.Generic;
19-
using Tensorflow.Contexts;
2018
using static Tensorflow.Binding;
2119

2220
namespace Tensorflow

src/TensorFlowNET.Core/APIs/tf.control_flow.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ limitations under the License.
1515
******************************************************************************/
1616

1717
using System;
18-
using static Tensorflow.Binding;
1918

2019
namespace Tensorflow
2120
{
@@ -42,19 +41,19 @@ public Tensor cond(Tensor pred,
4241
public Operation group<T>(T[] inputs, string name = null) where T : ITensorOrOperation
4342
=> control_flow_ops.group(inputs, name: name);
4443

45-
public Tensor while_loop(Func<Tensor, Tensor> cond,
46-
Func<Tensor, Tensor> body,
44+
public Tensor while_loop(Func<Tensor, Tensor> cond,
45+
Func<Tensor, Tensor> body,
4746
Tensor loop_vars,
4847
int parallel_iterations = 10)
4948
{
50-
Func<Tensor[], Tensor> cond1 = x
49+
Func<Tensor[], Tensor> cond1 = x
5150
=> cond(x[0]);
5251

53-
Func<Tensor[], Tensor[]> body1 = x
52+
Func<Tensor[], Tensor[]> body1 = x
5453
=> new[] { body(x[0]) };
5554

56-
var results = control_flow_ops.while_loop(cond1,
57-
body1,
55+
var results = control_flow_ops.while_loop(cond1,
56+
body1,
5857
new[] { loop_vars });
5958
return results[0];
6059
}
@@ -68,7 +67,7 @@ public Tensor[] while_loop(Func<Tensor[], Tensor> cond,
6867
parallel_iterations: parallel_iterations,
6968
name: name);
7069

71-
public _ControlDependenciesController control_dependencies(ITensorOrOperation[] control_inputs)
70+
public _ControlDependenciesController control_dependencies(ITensorOrOperation[] control_inputs)
7271
=> ops.control_dependencies(control_inputs);
7372
}
7473
}

src/TensorFlowNET.Core/APIs/tf.data.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ You may obtain a copy of the License at
1414
limitations under the License.
1515
******************************************************************************/
1616

17-
using NumSharp;
18-
1917
namespace Tensorflow
2018
{
2119
public partial class tensorflow

src/TensorFlowNET.Core/APIs/tf.data_flow.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ You may obtain a copy of the License at
1414
limitations under the License.
1515
******************************************************************************/
1616

17-
using System;
18-
1917
namespace Tensorflow
2018
{
2119
public partial class tensorflow

src/TensorFlowNET.Core/APIs/tf.debugging.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public Tensor assert_equal<T1, T2>(T1 t1,
3434
object[] data = null,
3535
string message = null,
3636
string name = null)
37-
=> check_ops.assert_equal(t1,
38-
t2,
39-
data: data,
40-
message: message,
37+
=> check_ops.assert_equal(t1,
38+
t2,
39+
data: data,
40+
message: message,
4141
name: name);
4242

4343
public Tensor assert_greater_equal<T1, T2>(Tensor x,

src/TensorFlowNET.Core/APIs/tf.gradients.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ public Tensor[] gradients(Tensor[] ys,
4040
int? aggregation_method = null,
4141
Tensor[] stop_gradients = null)
4242
{
43-
return gradients_util._GradientsHelper(ys,
44-
xs,
45-
grad_ys,
46-
name,
47-
colocate_gradients_with_ops,
43+
return gradients_util._GradientsHelper(ys,
44+
xs,
45+
grad_ys,
46+
name,
47+
colocate_gradients_with_ops,
4848
gate_gradients,
4949
stop_gradients: stop_gradients);
5050
}

0 commit comments

Comments
 (0)