Skip to content

Commit

Permalink
remove all trailing whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
cgarciae committed Oct 7, 2022
1 parent 75886ca commit 442df07
Showing 72 changed files with 364 additions and 365 deletions.
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -10,11 +10,11 @@ assignees: ''
Provide as much information as possible. At least, this should include a description of your issue and steps to reproduce the problem. If possible also provide a summary of what steps or workarounds you have already tried.

### System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
- Flax, jax, jaxlib versions (obtain with `pip show flax jax jaxlib`:
- Python version:
- GPU/TPU model and memory:
- CUDA version (if applicable):
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
- Flax, jax, jaxlib versions (obtain with `pip show flax jax jaxlib`:
- Python version:
- GPU/TPU model and memory:
- CUDA version (if applicable):


### Problem you have encountered:
10 changes: 5 additions & 5 deletions .github/analytics/get_repo_metrics.py
Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@ def parse_single_query(data, query_type):
Parses the data returned by `send_query`
.. warning::
Like `send_query`, the logic here depends on the specific structure
of the query (e.g. it must be an issue or PR query, and must have a
total count).
@@ -206,7 +206,7 @@ def _get_pr_features(prs):
time_labeled_or_assigned = None
time_merged_or_closed = None
time_review = None

if pr["reviews"]["nodes"]:
review = pr["reviews"]["nodes"][0]
time_review = _to_datetime(review["createdAt"])
@@ -258,9 +258,9 @@ def _shift_n_months(date: datetime, n: int) -> datetime:


def _rolling_window(
df: pd.DataFrame,
f: Callable[[pd.DataFrame], pd.Series],
window_size: int = 6,
df: pd.DataFrame,
f: Callable[[pd.DataFrame], pd.Series],
window_size: int = 6,
step: int = 1,
) -> pd.DataFrame:
# start of month of the first issue
6 changes: 3 additions & 3 deletions .github/analytics/issue_activity_since_date.gql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
# Queries all the issues in a repo. For each issue, we get some basic data such as
# the number, state, labels, and title. The most important part is the 'timelineItems'
# which are the events that happened to the issue, we can use the information about
# the number, state, labels, and title. The most important part is the 'timelineItems'
# which are the events that happened to the issue, we can use the information about
# the datetime about certain key events to define some metrics. Note that we are
# getting more information than is probably needed but its fine for now.
repository(owner: "_REPO_OWNER_", name: "_REPO_NAME_") {
@@ -52,7 +52,7 @@
}
}
}
}
}
}
}
}
6 changes: 3 additions & 3 deletions .github/analytics/pr_data_query.gql
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
query {
# Queries all the Pull Requests in a repo. For each issue, we get some basic data such as
# the number, state, reviews, and title. The most important part is the 'timelineItems'
# which are the events that happened to the issue, we can use the information about
# the number, state, reviews, and title. The most important part is the 'timelineItems'
# which are the events that happened to the issue, we can use the information about
# the datetime about certain key events to define some metrics. We also use the 'reviews'
# as indicators for certain metrics. Note that we are getting more information than is
# as indicators for certain metrics. Note that we are getting more information than is
# probably needed but its fine for now.
repository(owner:"_REPO_OWNER_", name:"_REPO_NAME_") {
pullRequests(first:100) {
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

<!--
Great, you are contributing to Flax!
Great, you are contributing to Flax!
But... please read the following carefully so we can make sure your PR is merged
easily.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -36,14 +36,14 @@ jobs:
- name: Cancel previous
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
access_token: ${{ github.token }}
- uses: actions/checkout@v2
# We allow at most 5 commits in a branch to ensure our CI doesn't break.
- name: Check commit count in PR
if: always()
shell: bash
run: |
set -x
set -x
# $GITHUB_REF is in format `refs/heads/<branch_name>`. We fetch it under
# the name `commit-count` so we can refer to it below.
# Do an unshallow fetch so we retrieve all commits (this is necessary
@@ -75,7 +75,7 @@ jobs:
- name: Cancel previous
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ New features:
- Added async option to `save_checkpoints()` on single-process scenario.
- Improved documentation pages.

Bug fixes:
Bug fixes:
- Fixed variable aliasing in put_variable
- Fixed missing passthrough of nn.scan unroll arg
- Fixed the MNIST example
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ To upgrade to the latest version of Flax, you can use:

## What does Flax look like?

We provide three examples using the Flax API: a simple multi-layer perceptron, a CNN and an auto-encoder.
We provide three examples using the Flax API: a simple multi-layer perceptron, a CNN and an auto-encoder.

To learn more about the `Module` abstraction, see our [docs](https://flax.readthedocs.io/), our [broad intro to the Module abstraction](https://github.com/google/flax/blob/main/docs/notebooks/linen_intro.ipynb). For additional concrete demonstrations of best practices, see our
[HOWTO guides](https://flax.readthedocs.io/en/latest/howtos.html).
@@ -174,11 +174,11 @@ decoded = model.apply(variables, encoded, method=model.decode)

## 🤗 Hugging Face

In-detail examples to train and evaluate a variety of Flax models for
Natural Language Processing, Computer Vision, and Speech Recognition are
In-detail examples to train and evaluate a variety of Flax models for
Natural Language Processing, Computer Vision, and Speech Recognition are
actively maintained in the [🤗 Transformers repository](https://github.com/huggingface/transformers/tree/master/examples/flax).

As of October 2021, the [19 most-used Transformer architectures](https://huggingface.co/transformers/#supported-frameworks) are supported in Flax
As of October 2021, the [19 most-used Transformer architectures](https://huggingface.co/transformers/#supported-frameworks) are supported in Flax
and over 5000 pretrained checkpoints in Flax have been uploaded to the [🤗 Hub](https://huggingface.co/models?library=jax&sort=downloads).

## Citing Flax
6 changes: 3 additions & 3 deletions dev/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@
"context": "..",
"dockerFile": "Dockerfile",

// Use 'settings' to set *default* container specific settings.json values on container create.
// Use 'settings' to set *default* container specific settings.json values on container create.
// You can edit these settings after create using File > Preferences > Settings > Remote.
"settings": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"python.pythonPath": "/usr/local/bin/python",
"python.linting.enabled": true,
@@ -24,7 +24,7 @@
"runArgs": ["-v", "${env:HOME}${env:USERPROFILE}/.ssh:/root/.ssh-localhost:ro"],
"postCreateCommand": "sudo cp -r /root/.ssh-localhost ~/.ssh && sudo chown -R $(id -u):$(id -g) ~/.ssh && chmod 700 ~/.ssh && chmod 600 ~/.ssh/* && pip install -e ./flax",

// Uncomment the next line to have VS Code connect as an existing non-root user in the container.
// Uncomment the next line to have VS Code connect as an existing non-root user in the container.
// On Linux, by default, the container user's UID/GID will be updated to match your local user. See
// https://aka.ms/vscode-remote/containers/non-root for details on adding a non-root user if none exist.
// "remoteUser": "vscode",
10 changes: 5 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ use the following notation:
#
# def sum(a, b):
# return a + b
#
#
# sum(0, 1)
```

@@ -87,19 +87,19 @@ You can use the second method if the `path_to_obj` is very long. Some examples:
# :func:`my_func`

# Create a reference "Module.apply()" to method flax.linen.Module.apply.
# :meth:`Module.apply() <flax.linen.Module.apply>` #
```
# :meth:`Module.apply() <flax.linen.Module.apply>` #
```

To creata a hyperlink, use the following syntax:
```bash
# Note the double underscore at the end:
# Note the double underscore at the end:
# `Link to Google <http://www.google.com>`__
```

### How to specify arguments for classes and methods

* Class attributes should be specified using the `Attributes:` tag.
* Method argument should be specified using the `Args:` tags.
* Method argument should be specified using the `Args:` tags.
* All attributes and arguments should have types.

Here is an example from our library:
4 changes: 2 additions & 2 deletions docs/_ext/codediff.py
Original file line number Diff line number Diff line change
@@ -75,10 +75,10 @@ def _code_block(self, lines):

def _tabs(self, *contents: Tuple[str, List[str]], sync):
output = ['.. tab-set::'] + [' ']

for title, content in contents:
output += [f' .. tab-item:: {title}']

if sync:
key = title.strip()
output += [f' :sync: {key}']
2 changes: 1 addition & 1 deletion docs/_ext/codediff_test.py
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ class CodeDiffTest(absltest.TestCase):
def test_parse(self):

input_text = r'''@jax.jit #!
def get_initial_params(key): #!
def get_initial_params(key): #!
init_val = jnp.ones((1, 28, 28, 1), jnp.float32)
initial_params = CNN().init(key, init_val)['params']
extra_line
4 changes: 2 additions & 2 deletions docs/_templates/autosummary/flax_module.rst
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@

{% block methods %}

.. automethod:: __call__
.. automethod:: __call__

{% if methods %}
.. rubric:: Methods

16 changes: 8 additions & 8 deletions docs/advanced_topics/contributing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to Contribute

Everyone can contribute to Flax, and we value everyone's contributions.
Everyone can contribute to Flax, and we value everyone's contributions.
You can contribute in many more ways than just writing code. Answering questions
on our [Discussions page](https://github.com/google/flax/discussions), helping
each other, and improving our documentation are extremely valuable to our
@@ -32,7 +32,7 @@ Follow these steps to contribute code:

2. Install Python >=3.6 and `svn` for running the tests (see below).

3. (Optional) Create a virtual environment or a Docker container. See
3. (Optional) Create a virtual environment or a Docker container. See
[`dev/README.md`](https://github.com/google/flax/blob/main/dev/README.md)
for details on how to setup a Docker Container. To setup a virtual environment,
run the following:
@@ -41,7 +41,7 @@ Follow these steps to contribute code:
python3.6 -m virtualenv env
. env/bin/activate
```

This ensures all your dependencies are installed in this environment.

4. `pip install` your fork from source. This allows you to modify the code
@@ -57,7 +57,7 @@ Follow these steps to contribute code:

5. Setup pre-commit hooks, this will run some automated checks during each `git` commit and
possibly update some files that require changes.

```bash
pip install pre-commit
pre-commit install
@@ -87,7 +87,7 @@ Follow these steps to contribute code:
./tests/run_all_tests.sh
```

9. Once your change is done, create a commit as follows
9. Once your change is done, create a commit as follows
([how to write a commit message](https://chris.beams.io/posts/git-commit/)):

```bash
@@ -101,17 +101,17 @@ Follow these steps to contribute code:
git rebase upstream/main
```

11. Finally push your commit on your development branch and create a remote
11. Finally push your commit on your development branch and create a remote
branch in your fork that you can use to create a Pull Request from:

```bash
git push --set-upstream origin name-of-change
```

After running the command, you should see a Github link in your terminal output that you can click on to create a Pull Request.
If you do not see this link in the terminal after doing a `git push`, go to the Github web UI; there should be a button there that lets you turn the commit into a Pull Request yourself.

11. Make sure your PR passes the
11. Make sure your PR passes the
[PR checklist](https://github.com/google/flax/blob/main/.github/pull_request_template.md#checklist).
If so, create a Pull Request from the Flax repository and send it for review.
Consult [GitHub Help](https://help.github.com/articles/about-pull-requests/)
Loading

0 comments on commit 442df07

Please sign in to comment.