colossalai.context.config

class colossalai.context.config.Config(config=None)[source]

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)[source]

Reads a python file and constructs a corresponding Config object.

Parameters

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

Returns

A Config object constructed with information in the file.

Return type

Config

Raises

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