vortex_torch.utils¶
Classes
|
|
|
|
|
|
|
- class ElementwiseBinaryOpType(*values)[source]¶
Bases:
Enum- Maximum = 0¶
- Minimum = 1¶
- Add = 2¶
- Mul = 3¶
- WhereEqual = 4¶
- WhereNotEqual = 5¶
- WhereGreater = 6¶
- WhereGreaterEqual = 7¶
- WhereLess = 8¶
- WhereLessEqual = 9¶
- class ElementwiseOpType(*values)[source]¶
Bases:
Enum- Relu = 0¶
- Sigmoid = 1¶
- Silu = 2¶
- Abs = 3¶
- Add_Mul = 4¶
- Log = 5¶
- Exp = 6¶
- DTYPE_STR_TO_TORCH = {'bfloat16': torch.bfloat16, 'float16': torch.float16, 'float32': torch.float32, 'fp8_e4m3fn': torch.float8_e4m3fn, 'fp8_e5m2': torch.float8_e5m2}¶
Canonical string ->
torch.dtype. Keep this one-to-one; aliases go in_DTYPE_ALIASESso tooling that prints the valid set (choices=, error messages) can show canonical names without alias noise.
- resolve_dtype(value, default=torch.bfloat16)[source]¶
Resolve a dtype given either a
torch.dtypeor a canonical string.Accepts
None(returnsdefault), atorch.dtype(returned as-is), a canonical string inDTYPE_STR_TO_TORCH, or a short alias in_DTYPE_ALIASES.- Parameters:
default (torch.dtype)
- Return type:
torch.dtype