This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch.nn as nn | |
from ray.air import session | |
from ray.air.config import ScalingConfig | |
from ray.train.torch import TorchCheckpoint, TorchTrainer | |
class Identity(nn.Module): | |
def forward(self, x): | |
return x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Dict | |
import pandas as pd | |
import pyarrow | |
import ray | |
import tensorflow as tf | |
from ray.data.block import Block | |
from ray.data.datasource.file_based_datasource import FileBasedDatasource |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download raw dataset | |
pip install --upgrade kaggle | |
mkdir -p ~/.kaggle | |
echo '{"username":"...","key":"..."}' > ~/.kaggle/kaggle.json | |
kaggle competitions download -c imagenet-object-localization-challenge -f imagenet_object_localization_patched2019.tar.gz | |
# Extract images | |
mkdir -p ~/data | |
mv imagenet_object_localization_patched2019.tar.gz data | |
cd ~/data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from github import Github | |
MESSAGE = """ | |
## :bangbang: ACTION REQUIRED :bangbang: | |
We've switched our code formatter from YAPF to Black (see #21311). | |
To prevent issues with merging your code, here's what you'll need to do: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Move to top-level directory. | |
cd $(git rev-parse --show-toplevel) | |
BLACK_VERSION_REQUIRED="21.12b0" | |
# Check if Black exists | |
if ! [ -x "$(command -v black)" ]; then | |
echo "Black is not installed." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Checks which pull requests contain merge conflicts with Blackened code.""" | |
import os | |
import shlex | |
import subprocess | |
import tempfile | |
import github | |
import tqdm | |
NewerOlder