mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-03 18:19:58 +00:00
[misc] update pre-commit and run all files (#4752)
* [misc] update pre-commit * [misc] run pre-commit * [misc] remove useless configuration files * [misc] ignore cuda for clang-format
This commit is contained in:
@@ -3,23 +3,23 @@
|
||||
|
||||
train_data = dict(
|
||||
dataset=dict(
|
||||
type='CIFAR10Dataset',
|
||||
root='/path/to/data',
|
||||
type="CIFAR10Dataset",
|
||||
root="/path/to/data",
|
||||
download=True,
|
||||
transform_pipeline=[
|
||||
dict(type='RandomResizedCrop', size=224),
|
||||
dict(type='RandomHorizontalFlip'),
|
||||
dict(type='ToTensor'),
|
||||
dict(type='Normalize', mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5))
|
||||
]
|
||||
dict(type="RandomResizedCrop", size=224),
|
||||
dict(type="RandomHorizontalFlip"),
|
||||
dict(type="ToTensor"),
|
||||
dict(type="Normalize", mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5)),
|
||||
],
|
||||
),
|
||||
dataloader=dict(
|
||||
batch_size=64,
|
||||
pin_memory=True,
|
||||
num_workers=4,
|
||||
sampler=dict(
|
||||
type='DataParallelSampler',
|
||||
type="DataParallelSampler",
|
||||
shuffle=True,
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
)
|
||||
|
@@ -3,16 +3,15 @@
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from colossalai.context.config import Config
|
||||
|
||||
|
||||
def test_load_config():
|
||||
filename = Path(__file__).parent.joinpath('sample_config.py')
|
||||
filename = Path(__file__).parent.joinpath("sample_config.py")
|
||||
config = Config.from_file(filename)
|
||||
|
||||
assert config.train_data, 'cannot access train data as attribute'
|
||||
assert config.train_data.dataset, 'cannot access grandchild attribute'
|
||||
assert isinstance(config.train_data.dataset.transform_pipeline[0], dict), \
|
||||
f'expected attribute transform_pipeline elements to be a dict, but found {type(config.train_data.dataset.transform_pipeline)}'
|
||||
assert config.train_data, "cannot access train data as attribute"
|
||||
assert config.train_data.dataset, "cannot access grandchild attribute"
|
||||
assert isinstance(
|
||||
config.train_data.dataset.transform_pipeline[0], dict
|
||||
), f"expected attribute transform_pipeline elements to be a dict, but found {type(config.train_data.dataset.transform_pipeline)}"
|
||||
|
Reference in New Issue
Block a user