Domains

class Domain[source]

Bases: funsor.domains.Domain

An object representing the type and shape of a Funsor input or output.

num_elements[source]
size
reals(*shape)[source]

Construct a real domain of given shape.

bint(size)[source]

Construct a bounded integer domain of scalar shape.

find_domain(op, *domains)[source]

Finds the Domain resulting when applying op to domains. :param callable op: An operation. :param Domain *domains: One or more input domains.