Skip to content

allenact.utils.misc_utils#

[view_source]

experimental_api#

experimental_api(to_decorate)

[view_source]

Decorate a function to note that it is part of the experimental API.

deprecated#

deprecated(to_decorate)

[view_source]

Decorate a function to note that it has been deprecated.

NumpyJSONEncoder#

class NumpyJSONEncoder(json.JSONEncoder)

[view_source]

JSON encoder for numpy objects.

Based off the stackoverflow answer by Jie Yang here: https://stackoverflow.com/a/57915246. The license for this code is BY-SA 4.0.

HashableDict#

class HashableDict(dict)

[view_source]

A dictionary which is hashable so long as all of its values are hashable.

A HashableDict object will allow setting / deleting of items until the first time that __hash__() is called on it after which attempts to set or delete items will throw RuntimeError exceptions.