Class ObservationWriter
Allows sensors to write to both TensorProxy and float arrays/lists.
Namespace: Unity.MLAgents.Sensors
Syntax
public class ObservationWriter : object
Properties
Item[Int32]
1D write access at a specified index. Use AddList if possible instead.
Declaration
public float this[int index] { set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index to write to. |
Property Value
Type | Description |
---|---|
Single |
Item[Int32, Int32, Int32]
3D write access at the specified height, width, and channel. Only usable with a TensorProxy target.
Declaration
public float this[int h, int w, int ch] { set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | h | |
Int32 | w | |
Int32 | ch |
Property Value
Type | Description |
---|---|
Single |
Methods
AddRange(IEnumerable<Single>, Int32)
Write the range of floats
Declaration
public void AddRange(IEnumerable<float> data, int writeOffset = 0)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Single> | data | |
Int32 | writeOffset | Optional write offset. |