pymllm.ffi ========== .. py:module:: pymllm.ffi Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/pymllm/ffi/base/index Attributes ---------- .. autoapisummary:: pymllm.ffi.MLLM_FIND_TORCH_AVAILABLE pymllm.ffi.MLLM_FIND_NUMPY_AVAILABLE pymllm.ffi.float32 pymllm.ffi.float16 pymllm.ffi.bfloat16 pymllm.ffi.cpu pymllm.ffi.cuda pymllm.ffi.qnn Classes ------- .. autoapisummary:: pymllm.ffi.Device pymllm.ffi.DType pymllm.ffi.Tensor pymllm.ffi.Session Functions --------- .. autoapisummary:: pymllm.ffi.echo pymllm.ffi.initialize_context pymllm.ffi.shutdown_context pymllm.ffi.float32_ pymllm.ffi.float16_ pymllm.ffi.bfloat16_ pymllm.ffi.cpu_ pymllm.ffi.cuda_ pymllm.ffi.qnn_ pymllm.ffi.device pymllm.ffi.empty pymllm.ffi.zeros pymllm.ffi.ones pymllm.ffi.arange pymllm.ffi.random pymllm.ffi.is_torch_available pymllm.ffi.is_numpy_available pymllm.ffi.from_torch pymllm.ffi.from_numpy Package Contents ---------------- .. py:data:: MLLM_FIND_TORCH_AVAILABLE .. py:data:: MLLM_FIND_NUMPY_AVAILABLE .. py:function:: echo(rec) .. py:function:: initialize_context() .. py:function:: shutdown_context() .. py:class:: Device Bases: :py:obj:`tvm_ffi.Object` .. py:method:: to_pod() .. py:class:: DType Bases: :py:obj:`tvm_ffi.Object` .. py:method:: to_pod() .. py:function:: float32_() .. py:function:: float16_() .. py:function:: bfloat16_() .. py:function:: cpu_() .. py:function:: cuda_() .. py:function:: qnn_() .. py:class:: Tensor Bases: :py:obj:`tvm_ffi.Object` .. py:method:: __str__() .. py:property:: shape :type: tvm_ffi.Shape .. py:property:: dtype :type: DType .. py:property:: device :type: Device .. py:method:: tobytes() .. py:method:: __add__(other) .. py:method:: __sub__(other) .. py:method:: __mul__(other) .. py:method:: __div__(other) .. py:method:: __neg__(other) .. py:method:: abs() .. py:method:: clip(min_val, max_val) .. py:method:: min(dim = -1, keep_dim = False) .. py:method:: max(dim = -1, keep_dim = False) .. py:method:: sum(dim = -1, keep_dim = False) .. py:method:: mean(dim = -1, keep_dim = False) .. py:method:: transpose(dim0, dim1) .. py:property:: T :type: Tensor .. py:method:: view(shape) .. py:method:: unsqueeze(dim) .. py:method:: squeeze(dim) .. py:method:: permute(dims) .. py:method:: contiguous() .. py:method:: clone() .. py:method:: repeat(multiplier, dim) .. py:method:: to(dd) .. py:method:: cpu() .. py:method:: cuda() .. py:property:: name .. py:method:: set_name(name) .. py:method:: numel() .. py:property:: rank .. py:method:: is_contiguous() .. py:data:: float32 :type: DType .. py:data:: float16 :type: DType .. py:data:: bfloat16 :type: DType .. py:data:: cpu :type: Device .. py:data:: cuda :type: Device .. py:data:: qnn :type: Device .. py:function:: device(device_type) .. py:function:: empty(shape, dtype = float32, device_type = cpu) .. py:function:: zeros(shape, dtype = float32, device_type = cpu) .. py:function:: ones(shape, dtype = float32, device_type = cpu) .. py:function:: arange(start, end, step = 1, dtype = float32, device_type = cpu) .. py:function:: random(shape, start = -1.0, end = 1.0, dtype = float32, device_type = cpu) .. py:function:: is_torch_available() .. py:function:: is_numpy_available() .. py:function:: from_torch(torch_tensor) .. py:function:: from_numpy(numpy_tensor) .. py:class:: Session Bases: :py:obj:`tvm_ffi.Object`