colossalai.context.config

class colossalai.context.config.Config(config=None)

This is a wrapper class for dict objects so that values of which can be accessed as attributes.

Parameters

config (dict) – The dict object to be wrapped

static from_file(filename)

Reads a python file and constructs a corresponding Config object.

Parameters

filename (str) – Name of the file to construct the return object

Raises

AssertionError – Raises an AssertionError if the file does not exist, or the file is not .py file

Returns

A Config object constructed with information in the file

Return type

Config