Ensuring that your function can be compiled successfully.
Floating Point Values
float
built-in type.float
to 32 bits.numpy.float[16,32,64]
types:Integer Values
int
built-in type.int
to 32 bits.numpy.int[8,16,32,64]
types:Boolean Values
bool
built-in type.Tensor Values
numpy.typing.NDArray[T]
type, where T
is
the tensor element type.np.ndarray
type, but doing so will always assume a float32
element type (following
PyTorch semantics).Numpy data type | Muna data type |
---|---|
np.float16 | float16 |
np.float32 | float32 |
np.float64 | float64 |
np.int8 | int8 |
np.int16 | int16 |
np.int32 | int32 |
np.int64 | int64 |
np.uint8 | uint8 |
np.uint16 | uint16 |
np.uint32 | uint32 |
np.uint64 | uint64 |
bool | bool |
String Values
str
built-in type.List Values
list[T]
built-in type, where T
is the element type.T
is a Pydantic BaseModel
, a full JSON schema will be generated.T
is optional but strongly recommended because it is used to generate a schema for the parameter or
return value.Dictionary Values
BaseModel
subclass.dict[str, T]
built-in type.BaseModel
annotation, as it allows us to generate a full JSON schema.dict
annotation, they key type must be str
. The value type T
can be any arbitrary type.Image Values
PIL.Image.Image
type.Binary Values
bytes
built-in type.bytearray
built-in type.io.BytesIO
type.Functions
Statement | Status | Notes |
---|---|---|
Recursive functions | 🔨 | Recursive functions must have a return type annotation. |
Lambda expressions | 🚧 | Lambda expressions can be invoked, but cannot be used as objects. |
Literals
Collection | Status | Notes |
---|---|---|
List literals | 🚧 | List must contain primitive members (e.g. int , str ). |
Dictionary literals | 🚧 | Dictionary must contain primitive members (e.g. int , str ). |
Set literals | 🚧 | Set must contain primitive members (e.g. int , str ). |
Tuple literals | 🚧 | Tuple must contain primitive members (e.g. int , str ). |
Classes
Exceptions
Statement | Status | Notes |
---|---|---|
raise statements | 🔨 | |
try..except statement | 🔨 |
Supported Libraries