forked from SciSharp/TensorFlow.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathITape.cs
More file actions
29 lines (24 loc) · 802 Bytes
/
ITape.cs
File metadata and controls
29 lines (24 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using Tensorflow.Util;
namespace Tensorflow.Gradients
{
public interface ITape
{
void SetTapeId(int id);
bool ShouldRecord(Tensor[] tensors);
void StartRecord();
void StopRecord();
bool Persistent { get; }
void RecordOperation(string op_type,
Tensor[] input_tensors,
TapeTensor[] output_tensors,
BackwardFunction backward_function);
void VariableAccessed(ResourceVariable variable);
void Watch(Tensor x);
ResourceVariable[] WatchedVariables();
Tensor[] ComputeGradient(Tensor[] target_tensor_ids,
Tensor[] source_tensor_ids,
UnorderedMap<Tensor, TapeTensor> sources_that_are_targets,
Tensor[] output_gradients);
}
}