ExTorch.Utils.Types (extorch v0.3.0)

Copy Markdown

General type hierarchy comparison utils

Summary

Functions

Given a list/tuples with elements or lists/tuples of elements, determine the base type ExTorch.DType.base_type() that the list should have when converting it into a tensor.

Given two basic types, compare them and return the type that subsumes the other one.

Functions

collect_types(tup, acc)

@spec collect_types(list() | tuple() | number() | boolean(), MapSet.t()) :: MapSet.t()

Given a list/tuples with elements or lists/tuples of elements, determine the base type ExTorch.DType.base_type() that the list should have when converting it into a tensor.

compare_types(x, y)

Given two basic types, compare them and return the type that subsumes the other one.