Skip to content

Commit

Permalink
Minor fixes to examples in README.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 314119240
Change-Id: I6b5b7e9cfd4b7ee176aa98d299a62d14b7874712
  • Loading branch information
acassirer authored and copybara-github committed Jun 1, 2020
1 parent ea5df39 commit 49083d2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,23 @@ Write some data to the table:
client.insert([0, 1], priorities={'my_table': 1.0})
```

This creates an item with a reference to a single data element, `0`. An item can
also reference multiple data elements:
An item can also reference multiple data elements:

```python
# Creates three data elements (2, 3, and 4) and a single item `[2, 3, 4]` that
# references all three of them.
# Creates three data elements ([2, 2] , [3, 3], and [4, 4]) and a single item
# `[[2, 2], [3, 3], [4, 4]]` that references all three of them.
with client.writer(max_sequence_length=3) as writer:
writer.append(2)
writer.append(3)
writer.append(4)
writer.append([2, 2])
writer.append([3, 3])
writer.append([4, 4])
writer.create_item('my_table', num_timesteps=3, priority=1.0)
```

The items we have added to Reverb can be read by sampling them:

```python
print(list(client.sample('my_table', num_samples=2))) # client.sample() returns a generator
# client.sample() returns a generator.
print(list(client.sample('my_table', num_samples=2)))
```

Continue with the
Expand Down

0 comments on commit 49083d2

Please sign in to comment.