mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-26 02:33:21 +08:00
1 line
95 KiB
JavaScript
1 line
95 KiB
JavaScript
Search.setIndex({"docnames": ["cpp/ops", "dev/extensions", "examples/linear_regression", "examples/llama-inference", "examples/mlp", "index", "install", "python/_autosummary/mlx.core.Device", "python/_autosummary/mlx.core.Dtype", "python/_autosummary/mlx.core.Stream", "python/_autosummary/mlx.core.abs", "python/_autosummary/mlx.core.add", "python/_autosummary/mlx.core.all", "python/_autosummary/mlx.core.allclose", "python/_autosummary/mlx.core.any", "python/_autosummary/mlx.core.arange", "python/_autosummary/mlx.core.arccos", "python/_autosummary/mlx.core.arccosh", "python/_autosummary/mlx.core.arcsin", "python/_autosummary/mlx.core.arcsinh", "python/_autosummary/mlx.core.arctan", "python/_autosummary/mlx.core.arctanh", "python/_autosummary/mlx.core.argmax", "python/_autosummary/mlx.core.argmin", "python/_autosummary/mlx.core.argpartition", "python/_autosummary/mlx.core.argsort", "python/_autosummary/mlx.core.array", "python/_autosummary/mlx.core.array.T", "python/_autosummary/mlx.core.array.abs", "python/_autosummary/mlx.core.array.all", "python/_autosummary/mlx.core.array.any", "python/_autosummary/mlx.core.array.argmax", "python/_autosummary/mlx.core.array.argmin", "python/_autosummary/mlx.core.array.astype", "python/_autosummary/mlx.core.array.cos", "python/_autosummary/mlx.core.array.dtype", "python/_autosummary/mlx.core.array.exp", "python/_autosummary/mlx.core.array.item", "python/_autosummary/mlx.core.array.log", "python/_autosummary/mlx.core.array.log1p", "python/_autosummary/mlx.core.array.logsumexp", "python/_autosummary/mlx.core.array.max", "python/_autosummary/mlx.core.array.mean", "python/_autosummary/mlx.core.array.min", "python/_autosummary/mlx.core.array.ndim", "python/_autosummary/mlx.core.array.prod", "python/_autosummary/mlx.core.array.reciprocal", "python/_autosummary/mlx.core.array.reshape", "python/_autosummary/mlx.core.array.round", "python/_autosummary/mlx.core.array.rsqrt", "python/_autosummary/mlx.core.array.shape", "python/_autosummary/mlx.core.array.sin", "python/_autosummary/mlx.core.array.size", "python/_autosummary/mlx.core.array.split", "python/_autosummary/mlx.core.array.sqrt", "python/_autosummary/mlx.core.array.square", "python/_autosummary/mlx.core.array.sum", "python/_autosummary/mlx.core.array.tolist", "python/_autosummary/mlx.core.array.transpose", "python/_autosummary/mlx.core.array.var", "python/_autosummary/mlx.core.array_equal", "python/_autosummary/mlx.core.broadcast_to", "python/_autosummary/mlx.core.ceil", "python/_autosummary/mlx.core.clip", "python/_autosummary/mlx.core.concatenate", "python/_autosummary/mlx.core.conv1d", "python/_autosummary/mlx.core.conv2d", "python/_autosummary/mlx.core.convolve", "python/_autosummary/mlx.core.cos", "python/_autosummary/mlx.core.cosh", "python/_autosummary/mlx.core.default_device", "python/_autosummary/mlx.core.default_stream", "python/_autosummary/mlx.core.dequantize", "python/_autosummary/mlx.core.divide", "python/_autosummary/mlx.core.equal", "python/_autosummary/mlx.core.erf", "python/_autosummary/mlx.core.erfinv", "python/_autosummary/mlx.core.eval", "python/_autosummary/mlx.core.exp", "python/_autosummary/mlx.core.expand_dims", "python/_autosummary/mlx.core.eye", "python/_autosummary/mlx.core.fft.fft", "python/_autosummary/mlx.core.fft.fft2", "python/_autosummary/mlx.core.fft.fftn", "python/_autosummary/mlx.core.fft.ifft", "python/_autosummary/mlx.core.fft.ifft2", "python/_autosummary/mlx.core.fft.ifftn", "python/_autosummary/mlx.core.fft.irfft", "python/_autosummary/mlx.core.fft.irfft2", "python/_autosummary/mlx.core.fft.irfftn", "python/_autosummary/mlx.core.fft.rfft", "python/_autosummary/mlx.core.fft.rfft2", "python/_autosummary/mlx.core.fft.rfftn", "python/_autosummary/mlx.core.flatten", "python/_autosummary/mlx.core.floor", "python/_autosummary/mlx.core.floor_divide", "python/_autosummary/mlx.core.full", "python/_autosummary/mlx.core.grad", "python/_autosummary/mlx.core.greater", "python/_autosummary/mlx.core.greater_equal", "python/_autosummary/mlx.core.identity", "python/_autosummary/mlx.core.jvp", "python/_autosummary/mlx.core.less", "python/_autosummary/mlx.core.less_equal", "python/_autosummary/mlx.core.linspace", "python/_autosummary/mlx.core.load", "python/_autosummary/mlx.core.log", "python/_autosummary/mlx.core.log10", "python/_autosummary/mlx.core.log1p", "python/_autosummary/mlx.core.log2", "python/_autosummary/mlx.core.logaddexp", "python/_autosummary/mlx.core.logical_not", "python/_autosummary/mlx.core.logsumexp", "python/_autosummary/mlx.core.matmul", "python/_autosummary/mlx.core.max", "python/_autosummary/mlx.core.maximum", "python/_autosummary/mlx.core.mean", "python/_autosummary/mlx.core.min", "python/_autosummary/mlx.core.minimum", "python/_autosummary/mlx.core.moveaxis", "python/_autosummary/mlx.core.multiply", "python/_autosummary/mlx.core.negative", "python/_autosummary/mlx.core.new_stream", "python/_autosummary/mlx.core.ones", "python/_autosummary/mlx.core.ones_like", "python/_autosummary/mlx.core.pad", "python/_autosummary/mlx.core.partition", "python/_autosummary/mlx.core.prod", "python/_autosummary/mlx.core.quantize", "python/_autosummary/mlx.core.quantized_matmul", "python/_autosummary/mlx.core.random.bernoulli", "python/_autosummary/mlx.core.random.categorical", "python/_autosummary/mlx.core.random.gumbel", "python/_autosummary/mlx.core.random.key", "python/_autosummary/mlx.core.random.normal", "python/_autosummary/mlx.core.random.randint", "python/_autosummary/mlx.core.random.seed", "python/_autosummary/mlx.core.random.split", "python/_autosummary/mlx.core.random.truncated_normal", "python/_autosummary/mlx.core.random.uniform", "python/_autosummary/mlx.core.reciprocal", "python/_autosummary/mlx.core.reshape", "python/_autosummary/mlx.core.round", "python/_autosummary/mlx.core.rsqrt", "python/_autosummary/mlx.core.save", "python/_autosummary/mlx.core.savez", "python/_autosummary/mlx.core.savez_compressed", "python/_autosummary/mlx.core.set_default_device", "python/_autosummary/mlx.core.set_default_stream", "python/_autosummary/mlx.core.sigmoid", "python/_autosummary/mlx.core.sign", "python/_autosummary/mlx.core.simplify", "python/_autosummary/mlx.core.sin", "python/_autosummary/mlx.core.sinh", "python/_autosummary/mlx.core.softmax", "python/_autosummary/mlx.core.sort", "python/_autosummary/mlx.core.split", "python/_autosummary/mlx.core.sqrt", "python/_autosummary/mlx.core.square", "python/_autosummary/mlx.core.squeeze", "python/_autosummary/mlx.core.stack", "python/_autosummary/mlx.core.stop_gradient", "python/_autosummary/mlx.core.subtract", "python/_autosummary/mlx.core.sum", "python/_autosummary/mlx.core.swapaxes", "python/_autosummary/mlx.core.take", "python/_autosummary/mlx.core.take_along_axis", "python/_autosummary/mlx.core.tan", "python/_autosummary/mlx.core.tanh", "python/_autosummary/mlx.core.transpose", "python/_autosummary/mlx.core.tri", "python/_autosummary/mlx.core.tril", "python/_autosummary/mlx.core.triu", "python/_autosummary/mlx.core.value_and_grad", "python/_autosummary/mlx.core.var", "python/_autosummary/mlx.core.vjp", "python/_autosummary/mlx.core.vmap", "python/_autosummary/mlx.core.where", "python/_autosummary/mlx.core.zeros", "python/_autosummary/mlx.core.zeros_like", "python/_autosummary/mlx.nn.Module", "python/_autosummary/mlx.nn.value_and_grad", "python/_autosummary/mlx.optimizers.AdaDelta", "python/_autosummary/mlx.optimizers.Adagrad", "python/_autosummary/mlx.optimizers.Adam", "python/_autosummary/mlx.optimizers.AdamW", "python/_autosummary/mlx.optimizers.Adamax", "python/_autosummary/mlx.optimizers.Lion", "python/_autosummary/mlx.optimizers.Optimizer", "python/_autosummary/mlx.optimizers.OptimizerState", "python/_autosummary/mlx.optimizers.RMSprop", "python/_autosummary/mlx.optimizers.SGD", "python/_autosummary/mlx.utils.tree_flatten", "python/_autosummary/mlx.utils.tree_map", "python/_autosummary/mlx.utils.tree_unflatten", "python/array", "python/data_types", "python/devices_and_streams", "python/fft", "python/nn", "python/nn/_autosummary/mlx.nn.Conv1d", "python/nn/_autosummary/mlx.nn.Conv2d", "python/nn/_autosummary/mlx.nn.Embedding", "python/nn/_autosummary/mlx.nn.GELU", "python/nn/_autosummary/mlx.nn.GroupNorm", "python/nn/_autosummary/mlx.nn.LayerNorm", "python/nn/_autosummary/mlx.nn.Linear", "python/nn/_autosummary/mlx.nn.Mish", "python/nn/_autosummary/mlx.nn.MultiHeadAttention", "python/nn/_autosummary/mlx.nn.PReLU", "python/nn/_autosummary/mlx.nn.QuantizedLinear", "python/nn/_autosummary/mlx.nn.RMSNorm", "python/nn/_autosummary/mlx.nn.ReLU", "python/nn/_autosummary/mlx.nn.RoPE", "python/nn/_autosummary/mlx.nn.SELU", "python/nn/_autosummary/mlx.nn.Sequential", "python/nn/_autosummary/mlx.nn.SiLU", "python/nn/_autosummary/mlx.nn.Step", "python/nn/_autosummary_functions/mlx.nn.gelu", "python/nn/_autosummary_functions/mlx.nn.gelu_approx", "python/nn/_autosummary_functions/mlx.nn.gelu_fast_approx", "python/nn/_autosummary_functions/mlx.nn.losses.binary_cross_entropy", "python/nn/_autosummary_functions/mlx.nn.losses.cross_entropy", "python/nn/_autosummary_functions/mlx.nn.losses.kl_div_loss", "python/nn/_autosummary_functions/mlx.nn.losses.l1_loss", "python/nn/_autosummary_functions/mlx.nn.losses.mse_loss", "python/nn/_autosummary_functions/mlx.nn.losses.nll_loss", "python/nn/_autosummary_functions/mlx.nn.losses.smooth_l1_loss", "python/nn/_autosummary_functions/mlx.nn.losses.triplet_loss", "python/nn/_autosummary_functions/mlx.nn.mish", "python/nn/_autosummary_functions/mlx.nn.prelu", "python/nn/_autosummary_functions/mlx.nn.relu", "python/nn/_autosummary_functions/mlx.nn.selu", "python/nn/_autosummary_functions/mlx.nn.silu", "python/nn/_autosummary_functions/mlx.nn.step", "python/nn/functions", "python/nn/layers", "python/nn/losses", "python/ops", "python/optimizers", "python/random", "python/transforms", "python/tree_utils", "quick_start", "unified_memory", "using_streams"], "filenames": ["cpp/ops.rst", "dev/extensions.rst", "examples/linear_regression.rst", "examples/llama-inference.rst", "examples/mlp.rst", "index.rst", "install.rst", "python/_autosummary/mlx.core.Device.rst", "python/_autosummary/mlx.core.Dtype.rst", "python/_autosummary/mlx.core.Stream.rst", "python/_autosummary/mlx.core.abs.rst", "python/_autosummary/mlx.core.add.rst", "python/_autosummary/mlx.core.all.rst", "python/_autosummary/mlx.core.allclose.rst", "python/_autosummary/mlx.core.any.rst", "python/_autosummary/mlx.core.arange.rst", "python/_autosummary/mlx.core.arccos.rst", "python/_autosummary/mlx.core.arccosh.rst", "python/_autosummary/mlx.core.arcsin.rst", "python/_autosummary/mlx.core.arcsinh.rst", "python/_autosummary/mlx.core.arctan.rst", "python/_autosummary/mlx.core.arctanh.rst", "python/_autosummary/mlx.core.argmax.rst", "python/_autosummary/mlx.core.argmin.rst", "python/_autosummary/mlx.core.argpartition.rst", "python/_autosummary/mlx.core.argsort.rst", "python/_autosummary/mlx.core.array.rst", "python/_autosummary/mlx.core.array.T.rst", "python/_autosummary/mlx.core.array.abs.rst", "python/_autosummary/mlx.core.array.all.rst", "python/_autosummary/mlx.core.array.any.rst", "python/_autosummary/mlx.core.array.argmax.rst", "python/_autosummary/mlx.core.array.argmin.rst", "python/_autosummary/mlx.core.array.astype.rst", "python/_autosummary/mlx.core.array.cos.rst", "python/_autosummary/mlx.core.array.dtype.rst", "python/_autosummary/mlx.core.array.exp.rst", "python/_autosummary/mlx.core.array.item.rst", "python/_autosummary/mlx.core.array.log.rst", "python/_autosummary/mlx.core.array.log1p.rst", "python/_autosummary/mlx.core.array.logsumexp.rst", "python/_autosummary/mlx.core.array.max.rst", "python/_autosummary/mlx.core.array.mean.rst", "python/_autosummary/mlx.core.array.min.rst", "python/_autosummary/mlx.core.array.ndim.rst", "python/_autosummary/mlx.core.array.prod.rst", "python/_autosummary/mlx.core.array.reciprocal.rst", "python/_autosummary/mlx.core.array.reshape.rst", "python/_autosummary/mlx.core.array.round.rst", "python/_autosummary/mlx.core.array.rsqrt.rst", "python/_autosummary/mlx.core.array.shape.rst", "python/_autosummary/mlx.core.array.sin.rst", "python/_autosummary/mlx.core.array.size.rst", "python/_autosummary/mlx.core.array.split.rst", "python/_autosummary/mlx.core.array.sqrt.rst", "python/_autosummary/mlx.core.array.square.rst", "python/_autosummary/mlx.core.array.sum.rst", "python/_autosummary/mlx.core.array.tolist.rst", "python/_autosummary/mlx.core.array.transpose.rst", "python/_autosummary/mlx.core.array.var.rst", "python/_autosummary/mlx.core.array_equal.rst", "python/_autosummary/mlx.core.broadcast_to.rst", "python/_autosummary/mlx.core.ceil.rst", "python/_autosummary/mlx.core.clip.rst", "python/_autosummary/mlx.core.concatenate.rst", "python/_autosummary/mlx.core.conv1d.rst", "python/_autosummary/mlx.core.conv2d.rst", "python/_autosummary/mlx.core.convolve.rst", "python/_autosummary/mlx.core.cos.rst", "python/_autosummary/mlx.core.cosh.rst", "python/_autosummary/mlx.core.default_device.rst", "python/_autosummary/mlx.core.default_stream.rst", "python/_autosummary/mlx.core.dequantize.rst", "python/_autosummary/mlx.core.divide.rst", "python/_autosummary/mlx.core.equal.rst", "python/_autosummary/mlx.core.erf.rst", "python/_autosummary/mlx.core.erfinv.rst", "python/_autosummary/mlx.core.eval.rst", "python/_autosummary/mlx.core.exp.rst", "python/_autosummary/mlx.core.expand_dims.rst", "python/_autosummary/mlx.core.eye.rst", "python/_autosummary/mlx.core.fft.fft.rst", "python/_autosummary/mlx.core.fft.fft2.rst", "python/_autosummary/mlx.core.fft.fftn.rst", "python/_autosummary/mlx.core.fft.ifft.rst", "python/_autosummary/mlx.core.fft.ifft2.rst", "python/_autosummary/mlx.core.fft.ifftn.rst", "python/_autosummary/mlx.core.fft.irfft.rst", "python/_autosummary/mlx.core.fft.irfft2.rst", "python/_autosummary/mlx.core.fft.irfftn.rst", "python/_autosummary/mlx.core.fft.rfft.rst", "python/_autosummary/mlx.core.fft.rfft2.rst", "python/_autosummary/mlx.core.fft.rfftn.rst", "python/_autosummary/mlx.core.flatten.rst", "python/_autosummary/mlx.core.floor.rst", "python/_autosummary/mlx.core.floor_divide.rst", "python/_autosummary/mlx.core.full.rst", "python/_autosummary/mlx.core.grad.rst", "python/_autosummary/mlx.core.greater.rst", "python/_autosummary/mlx.core.greater_equal.rst", "python/_autosummary/mlx.core.identity.rst", "python/_autosummary/mlx.core.jvp.rst", "python/_autosummary/mlx.core.less.rst", "python/_autosummary/mlx.core.less_equal.rst", "python/_autosummary/mlx.core.linspace.rst", "python/_autosummary/mlx.core.load.rst", "python/_autosummary/mlx.core.log.rst", "python/_autosummary/mlx.core.log10.rst", "python/_autosummary/mlx.core.log1p.rst", "python/_autosummary/mlx.core.log2.rst", "python/_autosummary/mlx.core.logaddexp.rst", "python/_autosummary/mlx.core.logical_not.rst", "python/_autosummary/mlx.core.logsumexp.rst", "python/_autosummary/mlx.core.matmul.rst", "python/_autosummary/mlx.core.max.rst", "python/_autosummary/mlx.core.maximum.rst", "python/_autosummary/mlx.core.mean.rst", "python/_autosummary/mlx.core.min.rst", "python/_autosummary/mlx.core.minimum.rst", "python/_autosummary/mlx.core.moveaxis.rst", "python/_autosummary/mlx.core.multiply.rst", "python/_autosummary/mlx.core.negative.rst", "python/_autosummary/mlx.core.new_stream.rst", "python/_autosummary/mlx.core.ones.rst", "python/_autosummary/mlx.core.ones_like.rst", "python/_autosummary/mlx.core.pad.rst", "python/_autosummary/mlx.core.partition.rst", "python/_autosummary/mlx.core.prod.rst", "python/_autosummary/mlx.core.quantize.rst", "python/_autosummary/mlx.core.quantized_matmul.rst", "python/_autosummary/mlx.core.random.bernoulli.rst", "python/_autosummary/mlx.core.random.categorical.rst", "python/_autosummary/mlx.core.random.gumbel.rst", "python/_autosummary/mlx.core.random.key.rst", "python/_autosummary/mlx.core.random.normal.rst", "python/_autosummary/mlx.core.random.randint.rst", "python/_autosummary/mlx.core.random.seed.rst", "python/_autosummary/mlx.core.random.split.rst", "python/_autosummary/mlx.core.random.truncated_normal.rst", "python/_autosummary/mlx.core.random.uniform.rst", "python/_autosummary/mlx.core.reciprocal.rst", "python/_autosummary/mlx.core.reshape.rst", "python/_autosummary/mlx.core.round.rst", "python/_autosummary/mlx.core.rsqrt.rst", "python/_autosummary/mlx.core.save.rst", "python/_autosummary/mlx.core.savez.rst", "python/_autosummary/mlx.core.savez_compressed.rst", "python/_autosummary/mlx.core.set_default_device.rst", "python/_autosummary/mlx.core.set_default_stream.rst", "python/_autosummary/mlx.core.sigmoid.rst", "python/_autosummary/mlx.core.sign.rst", "python/_autosummary/mlx.core.simplify.rst", "python/_autosummary/mlx.core.sin.rst", "python/_autosummary/mlx.core.sinh.rst", "python/_autosummary/mlx.core.softmax.rst", "python/_autosummary/mlx.core.sort.rst", "python/_autosummary/mlx.core.split.rst", "python/_autosummary/mlx.core.sqrt.rst", "python/_autosummary/mlx.core.square.rst", "python/_autosummary/mlx.core.squeeze.rst", "python/_autosummary/mlx.core.stack.rst", "python/_autosummary/mlx.core.stop_gradient.rst", "python/_autosummary/mlx.core.subtract.rst", "python/_autosummary/mlx.core.sum.rst", "python/_autosummary/mlx.core.swapaxes.rst", "python/_autosummary/mlx.core.take.rst", "python/_autosummary/mlx.core.take_along_axis.rst", "python/_autosummary/mlx.core.tan.rst", "python/_autosummary/mlx.core.tanh.rst", "python/_autosummary/mlx.core.transpose.rst", "python/_autosummary/mlx.core.tri.rst", "python/_autosummary/mlx.core.tril.rst", "python/_autosummary/mlx.core.triu.rst", "python/_autosummary/mlx.core.value_and_grad.rst", "python/_autosummary/mlx.core.var.rst", "python/_autosummary/mlx.core.vjp.rst", "python/_autosummary/mlx.core.vmap.rst", "python/_autosummary/mlx.core.where.rst", "python/_autosummary/mlx.core.zeros.rst", "python/_autosummary/mlx.core.zeros_like.rst", "python/_autosummary/mlx.nn.Module.rst", "python/_autosummary/mlx.nn.value_and_grad.rst", "python/_autosummary/mlx.optimizers.AdaDelta.rst", "python/_autosummary/mlx.optimizers.Adagrad.rst", "python/_autosummary/mlx.optimizers.Adam.rst", "python/_autosummary/mlx.optimizers.AdamW.rst", "python/_autosummary/mlx.optimizers.Adamax.rst", "python/_autosummary/mlx.optimizers.Lion.rst", "python/_autosummary/mlx.optimizers.Optimizer.rst", "python/_autosummary/mlx.optimizers.OptimizerState.rst", "python/_autosummary/mlx.optimizers.RMSprop.rst", "python/_autosummary/mlx.optimizers.SGD.rst", "python/_autosummary/mlx.utils.tree_flatten.rst", "python/_autosummary/mlx.utils.tree_map.rst", "python/_autosummary/mlx.utils.tree_unflatten.rst", "python/array.rst", "python/data_types.rst", "python/devices_and_streams.rst", "python/fft.rst", "python/nn.rst", "python/nn/_autosummary/mlx.nn.Conv1d.rst", "python/nn/_autosummary/mlx.nn.Conv2d.rst", "python/nn/_autosummary/mlx.nn.Embedding.rst", "python/nn/_autosummary/mlx.nn.GELU.rst", "python/nn/_autosummary/mlx.nn.GroupNorm.rst", "python/nn/_autosummary/mlx.nn.LayerNorm.rst", "python/nn/_autosummary/mlx.nn.Linear.rst", "python/nn/_autosummary/mlx.nn.Mish.rst", "python/nn/_autosummary/mlx.nn.MultiHeadAttention.rst", "python/nn/_autosummary/mlx.nn.PReLU.rst", "python/nn/_autosummary/mlx.nn.QuantizedLinear.rst", "python/nn/_autosummary/mlx.nn.RMSNorm.rst", "python/nn/_autosummary/mlx.nn.ReLU.rst", "python/nn/_autosummary/mlx.nn.RoPE.rst", "python/nn/_autosummary/mlx.nn.SELU.rst", "python/nn/_autosummary/mlx.nn.Sequential.rst", "python/nn/_autosummary/mlx.nn.SiLU.rst", "python/nn/_autosummary/mlx.nn.Step.rst", "python/nn/_autosummary_functions/mlx.nn.gelu.rst", "python/nn/_autosummary_functions/mlx.nn.gelu_approx.rst", "python/nn/_autosummary_functions/mlx.nn.gelu_fast_approx.rst", "python/nn/_autosummary_functions/mlx.nn.losses.binary_cross_entropy.rst", "python/nn/_autosummary_functions/mlx.nn.losses.cross_entropy.rst", "python/nn/_autosummary_functions/mlx.nn.losses.kl_div_loss.rst", "python/nn/_autosummary_functions/mlx.nn.losses.l1_loss.rst", "python/nn/_autosummary_functions/mlx.nn.losses.mse_loss.rst", "python/nn/_autosummary_functions/mlx.nn.losses.nll_loss.rst", "python/nn/_autosummary_functions/mlx.nn.losses.smooth_l1_loss.rst", "python/nn/_autosummary_functions/mlx.nn.losses.triplet_loss.rst", "python/nn/_autosummary_functions/mlx.nn.mish.rst", "python/nn/_autosummary_functions/mlx.nn.prelu.rst", "python/nn/_autosummary_functions/mlx.nn.relu.rst", "python/nn/_autosummary_functions/mlx.nn.selu.rst", "python/nn/_autosummary_functions/mlx.nn.silu.rst", "python/nn/_autosummary_functions/mlx.nn.step.rst", "python/nn/functions.rst", "python/nn/layers.rst", "python/nn/losses.rst", "python/ops.rst", "python/optimizers.rst", "python/random.rst", "python/transforms.rst", "python/tree_utils.rst", "quick_start.rst", "unified_memory.rst", "using_streams.rst"], "titles": ["Operations", "Developer Documentation", "Linear Regression", "LLM inference", "Multi-Layer Perceptron", "MLX", "Build and Install", "mlx.core.Device", "mlx.core.Dtype", "mlx.core.Stream", "mlx.core.abs", "mlx.core.add", "mlx.core.all", "mlx.core.allclose", "mlx.core.any", "mlx.core.arange", "mlx.core.arccos", "mlx.core.arccosh", "mlx.core.arcsin", "mlx.core.arcsinh", "mlx.core.arctan", "mlx.core.arctanh", "mlx.core.argmax", "mlx.core.argmin", "mlx.core.argpartition", "mlx.core.argsort", "mlx.core.array", "mlx.core.array.T", "mlx.core.array.abs", "mlx.core.array.all", "mlx.core.array.any", "mlx.core.array.argmax", "mlx.core.array.argmin", "mlx.core.array.astype", "mlx.core.array.cos", "mlx.core.array.dtype", "mlx.core.array.exp", "mlx.core.array.item", "mlx.core.array.log", "mlx.core.array.log1p", "mlx.core.array.logsumexp", "mlx.core.array.max", "mlx.core.array.mean", "mlx.core.array.min", "mlx.core.array.ndim", "mlx.core.array.prod", "mlx.core.array.reciprocal", "mlx.core.array.reshape", "mlx.core.array.round", "mlx.core.array.rsqrt", "mlx.core.array.shape", "mlx.core.array.sin", "mlx.core.array.size", "mlx.core.array.split", "mlx.core.array.sqrt", "mlx.core.array.square", "mlx.core.array.sum", "mlx.core.array.tolist", "mlx.core.array.transpose", "mlx.core.array.var", "mlx.core.array_equal", "mlx.core.broadcast_to", "mlx.core.ceil", "mlx.core.clip", "mlx.core.concatenate", "mlx.core.conv1d", "mlx.core.conv2d", "mlx.core.convolve", "mlx.core.cos", "mlx.core.cosh", "mlx.core.default_device", "mlx.core.default_stream", "mlx.core.dequantize", "mlx.core.divide", "mlx.core.equal", "mlx.core.erf", "mlx.core.erfinv", "mlx.core.eval", "mlx.core.exp", "mlx.core.expand_dims", "mlx.core.eye", "mlx.core.fft.fft", "mlx.core.fft.fft2", "mlx.core.fft.fftn", "mlx.core.fft.ifft", "mlx.core.fft.ifft2", "mlx.core.fft.ifftn", "mlx.core.fft.irfft", "mlx.core.fft.irfft2", "mlx.core.fft.irfftn", "mlx.core.fft.rfft", "mlx.core.fft.rfft2", "mlx.core.fft.rfftn", "mlx.core.flatten", "mlx.core.floor", "mlx.core.floor_divide", "mlx.core.full", "mlx.core.grad", "mlx.core.greater", "mlx.core.greater_equal", "mlx.core.identity", "mlx.core.jvp", "mlx.core.less", "mlx.core.less_equal", "mlx.core.linspace", "mlx.core.load", "mlx.core.log", "mlx.core.log10", "mlx.core.log1p", "mlx.core.log2", "mlx.core.logaddexp", "mlx.core.logical_not", "mlx.core.logsumexp", "mlx.core.matmul", "mlx.core.max", "mlx.core.maximum", "mlx.core.mean", "mlx.core.min", "mlx.core.minimum", "mlx.core.moveaxis", "mlx.core.multiply", "mlx.core.negative", "mlx.core.new_stream", "mlx.core.ones", "mlx.core.ones_like", "mlx.core.pad", "mlx.core.partition", "mlx.core.prod", "mlx.core.quantize", "mlx.core.quantized_matmul", "mlx.core.random.bernoulli", "mlx.core.random.categorical", "mlx.core.random.gumbel", "mlx.core.random.key", "mlx.core.random.normal", "mlx.core.random.randint", "mlx.core.random.seed", "mlx.core.random.split", "mlx.core.random.truncated_normal", "mlx.core.random.uniform", "mlx.core.reciprocal", "mlx.core.reshape", "mlx.core.round", "mlx.core.rsqrt", "mlx.core.save", "mlx.core.savez", "mlx.core.savez_compressed", "mlx.core.set_default_device", "mlx.core.set_default_stream", "mlx.core.sigmoid", "mlx.core.sign", "mlx.core.simplify", "mlx.core.sin", "mlx.core.sinh", "mlx.core.softmax", "mlx.core.sort", "mlx.core.split", "mlx.core.sqrt", "mlx.core.square", "mlx.core.squeeze", "mlx.core.stack", "mlx.core.stop_gradient", "mlx.core.subtract", "mlx.core.sum", "mlx.core.swapaxes", "mlx.core.take", "mlx.core.take_along_axis", "mlx.core.tan", "mlx.core.tanh", "mlx.core.transpose", "mlx.core.tri", "mlx.core.tril", "mlx.core.triu", "mlx.core.value_and_grad", "mlx.core.var", "mlx.core.vjp", "mlx.core.vmap", "mlx.core.where", "mlx.core.zeros", "mlx.core.zeros_like", "mlx.nn.Module", "mlx.nn.value_and_grad", "mlx.optimizers.AdaDelta", "mlx.optimizers.Adagrad", "mlx.optimizers.Adam", "mlx.optimizers.AdamW", "mlx.optimizers.Adamax", "mlx.optimizers.Lion", "mlx.optimizers.Optimizer", "mlx.optimizers.OptimizerState", "mlx.optimizers.RMSprop", "mlx.optimizers.SGD", "mlx.utils.tree_flatten", "mlx.utils.tree_map", "mlx.utils.tree_unflatten", "Array", "Data Types", "Devices and Streams", "FFT", "Neural Networks", "mlx.nn.Conv1d", "mlx.nn.Conv2d", "mlx.nn.Embedding", "mlx.nn.GELU", "mlx.nn.GroupNorm", "mlx.nn.LayerNorm", "mlx.nn.Linear", "mlx.nn.Mish", "mlx.nn.MultiHeadAttention", "mlx.nn.PReLU", "mlx.nn.QuantizedLinear", "mlx.nn.RMSNorm", "mlx.nn.ReLU", "mlx.nn.RoPE", "mlx.nn.SELU", "mlx.nn.Sequential", "mlx.nn.SiLU", "mlx.nn.Step", "mlx.nn.gelu", "mlx.nn.gelu_approx", "mlx.nn.gelu_fast_approx", "mlx.nn.losses.binary_cross_entropy", "mlx.nn.losses.cross_entropy", "mlx.nn.losses.kl_div_loss", "mlx.nn.losses.l1_loss", "mlx.nn.losses.mse_loss", "mlx.nn.losses.nll_loss", "mlx.nn.losses.smooth_l1_loss", "mlx.nn.losses.triplet_loss", "mlx.nn.mish", "mlx.nn.prelu", "mlx.nn.relu", "mlx.nn.selu", "mlx.nn.silu", "mlx.nn.step", "Functions", "Layers", "Loss Functions", "Operations", "Optimizers", "Random", "Transforms", "Tree Utils", "Quick Start Guide", "Unified Memory", "Using Streams"], "terms": {"mlx": [1, 2, 3, 4, 6, 199, 239, 240, 242, 243, 244], "provid": [1, 3, 72, 97, 144, 173, 180, 193, 199, 208, 210, 235, 245], "open": [1, 15, 135, 139], "flexibl": [1, 5], "which": [1, 3, 4, 5, 6, 15, 33, 77, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 97, 101, 105, 128, 131, 132, 141, 144, 145, 146, 159, 160, 165, 173, 175, 176, 203, 213, 222, 227, 240, 244, 245], "user": [1, 3, 199], "mai": 1, "add": [1, 3, 79, 110, 125, 128, 200, 201, 244], "special": 1, "without": [1, 3, 5, 161, 208, 235, 242, 244], "much": [1, 3], "hassl": 1, "while": [1, 3, 6, 141, 213], "librari": [1, 6, 199], "suppli": 1, "effici": [1, 3, 5, 213, 243], "can": [1, 3, 5, 6, 11, 15, 47, 58, 73, 74, 77, 98, 99, 102, 103, 110, 115, 118, 120, 130, 131, 135, 138, 139, 162, 173, 180, 199, 202, 215, 239, 240, 242, 243, 244, 245], "compos": [1, 5, 199, 243], "ani": [1, 3, 5, 15, 151, 192, 193, 194, 199, 203, 210, 242, 243, 244], "number": [1, 15, 52, 66, 72, 80, 97, 100, 101, 104, 125, 128, 129, 131, 134, 137, 139, 142, 151, 170, 173, 175, 176, 199, 200, 201, 204, 208, 240, 245], "applic": [1, 6], "aris": 1, "case": [1, 3, 83, 86, 87, 89, 90, 91, 92, 93, 113, 141, 159, 214, 217, 227, 232, 234, 243, 244, 245], "where": [1, 4, 80, 128, 173, 176, 200, 201, 203, 204, 205, 206, 211, 214, 216, 217, 218, 219, 220, 232, 233, 234], "new": [1, 4, 61, 119, 141, 160, 169, 180, 193, 208, 239], "function": [1, 2, 3, 4, 5, 13, 75, 76, 77, 97, 101, 113, 144, 149, 151, 173, 175, 176, 181, 193, 199, 203, 207, 215, 217, 218, 219, 220, 229, 230, 234, 239, 240, 242], "highli": [1, 6], "optim": [1, 2, 4, 5], "ar": [1, 2, 3, 4, 5, 6, 13, 15, 60, 61, 63, 67, 80, 82, 83, 85, 86, 88, 89, 91, 92, 97, 101, 113, 125, 126, 128, 130, 131, 132, 135, 138, 139, 144, 145, 146, 159, 160, 165, 173, 175, 176, 180, 187, 192, 193, 200, 201, 204, 205, 208, 210, 235, 242, 243, 244], "need": [1, 3, 4, 5, 60, 128, 199, 240, 243, 244], "For": [1, 3, 6, 128, 194, 199, 210, 240, 243, 244], "you": [1, 3, 4, 5, 6, 199, 240, 244], "design": [1, 2, 5, 240, 244], "your": [1, 3, 6, 180], "own": [1, 6], "link": [1, 6], "top": [1, 206], "core": [1, 2, 3, 4, 180, 199, 221, 239, 243], "we": [1, 2, 3, 4, 72, 128, 144, 185, 187, 199, 202, 215, 240, 242, 244], "inner": 1, "work": [1, 3, 6], "go": [1, 3], "over": [1, 3, 4, 12, 14, 22, 23, 24, 25, 65, 66, 83, 86, 89, 92, 104, 112, 114, 116, 117, 126, 127, 143, 154, 155, 163, 174, 200, 201, 204, 205, 211, 222], "simpl": [1, 3, 4, 199, 202, 235], "learn": [1, 2, 4, 5, 182, 183, 184, 185, 186, 187, 190, 191, 204, 205, 211], "step": [1, 3, 4, 15, 199], "involv": [1, 239], "ad": [1, 2, 6, 180, 182, 183, 184, 185, 186, 190], "let": [1, 2, 3], "s": [1, 2, 3, 4, 35, 44, 72, 82, 83, 85, 86, 88, 89, 91, 92, 97, 105, 116, 128, 131, 142, 173, 174, 176, 181, 188, 199, 239, 240, 243, 244], "sai": [1, 3], "would": [1, 3, 244], "like": [1, 3, 5, 124, 179, 243, 244], "an": [1, 3, 4, 6, 8, 12, 14, 26, 61, 65, 66, 77, 80, 93, 96, 100, 114, 117, 119, 123, 124, 125, 127, 128, 129, 141, 142, 156, 159, 164, 165, 166, 170, 176, 178, 179, 182, 188, 189, 192, 193, 199, 204, 205, 206, 208, 210, 219, 230, 240, 242, 243, 244, 245], "take": [1, 3, 4, 97, 101, 115, 118, 124, 129, 166, 173, 175, 176, 179, 240, 244, 245], "two": [1, 11, 13, 60, 73, 74, 82, 85, 91, 98, 99, 102, 103, 110, 113, 115, 118, 120, 164, 210, 244], "arrai": [1, 3, 4, 5, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 199, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 234, 243, 244], "x": [1, 2, 3, 4, 75, 100, 129, 132, 142, 145, 149, 151, 171, 172, 177, 180, 187, 193, 199, 203, 204, 205, 206, 207, 211, 212, 214, 216, 217, 218, 219, 220, 227, 229, 230, 231, 232, 233, 234, 239, 243, 244], "y": [1, 2, 3, 4, 151, 177, 183, 199, 204, 205, 206, 211, 227, 239], "scale": [1, 3, 72, 128, 129, 208, 214, 232], "them": [1, 3, 199, 244], "both": [1, 11, 73, 74, 98, 99, 102, 103, 110, 115, 118, 120, 131, 162, 239, 243, 244], "some": [1, 2, 3, 4], "coeffic": 1, "alpha": [1, 128, 185, 190, 214, 228, 230, 232], "beta": [1, 72, 128, 184, 185, 186, 187, 204, 205, 227], "respect": [1, 2, 4, 97, 128, 173, 180, 193, 199, 203, 204, 205, 243], "togeth": [1, 4, 128, 193], "get": [1, 2, 4, 66, 133, 189, 199, 244], "z": [1, 151], "well": [1, 3, 199, 208], "veri": [1, 3, 208, 244], "easili": 1, "do": [1, 3, 6, 180, 185, 199], "just": [1, 4], "write": [1, 3, 199], "out": [1, 6], "follow": [1, 3, 4, 5, 6, 15, 67, 72, 128, 182, 183, 184, 185, 186, 187, 191, 199, 219, 220, 223, 240, 244], "import": [1, 2, 3, 4, 6, 145, 151, 173, 180, 192, 193, 194, 199, 221, 243], "mx": [1, 2, 3, 4, 145, 151, 173, 180, 199, 212, 221, 223, 231, 239, 240, 243, 244, 245], "def": [1, 2, 3, 4, 151, 173, 180, 199, 244], "simple_axpbi": 1, "float": [1, 13, 15, 57, 95, 96, 129, 130, 135, 138, 139, 182, 183, 184, 185, 186, 187, 190, 191, 196, 204, 205, 211, 213, 217, 222, 227, 228, 234], "return": [1, 2, 3, 4, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 33, 37, 50, 57, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139, 140, 141, 142, 143, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 192, 193, 194, 199, 210, 221, 222, 223, 224, 225, 226, 227, 228, 242, 244], "thi": [1, 3, 4, 6, 12, 13, 14, 15, 22, 23, 24, 25, 77, 101, 110, 112, 113, 114, 116, 117, 126, 127, 131, 151, 154, 155, 156, 163, 165, 174, 180, 199, 210, 217, 219, 220, 234, 242], "perform": [1, 3, 5, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 113, 129, 142, 154, 165, 199, 204, 244], "leav": [1, 193], "differenti": [1, 5], "howev": [1, 199, 203, 204, 240], "vector": [1, 2, 5, 101, 165, 175, 176, 202, 243], "math": [1, 3, 228], "often": 1, "realiz": 1, "axpbi": 1, "routin": 1, "defin": [1, 2, 3, 4, 6, 189, 192], "same": [1, 3, 6, 60, 61, 66, 67, 87, 90, 91, 92, 97, 101, 125, 131, 142, 175, 177, 180, 199, 204, 210, 228, 240, 244], "realli": 1, "part": 1, "doe": [1, 3, 6, 199], "fast": [1, 151, 203, 220, 244], "so": [1, 3, 6, 97, 151, 173, 239, 244], "decid": [1, 193], "want": [1, 3, 244], "reli": 1, "acceler": 1, "framework": [1, 5], "continu": 1, "impos": 1, "our": [1, 3, 4, 182, 183, 184, 186, 187, 215], "assumpt": 1, "also": [1, 3, 4, 5, 11, 73, 74, 83, 86, 89, 92, 98, 99, 102, 103, 110, 115, 118, 120, 128, 162, 181, 189, 199, 208, 210, 214, 216, 218, 232, 233, 235, 239, 243, 245], "assum": [1, 3, 193, 199, 204], "how": [1, 3, 4, 199, 200, 201, 202, 208, 244], "gradient": [1, 2, 4, 97, 161, 173, 180, 181, 182, 184, 185, 186, 187, 191, 199, 210, 239, 243], "ins": 1, "what": [1, 3, 193], "coincid": 1, "right": [1, 128, 203, 219, 220, 228], "place": [1, 3, 142], "cours": 1, "The": [1, 3, 4, 5, 6, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 33, 35, 44, 50, 57, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139, 140, 141, 149, 150, 152, 153, 154, 155, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 196, 200, 201, 202, 204, 205, 206, 208, 210, 211, 213, 215, 217, 221, 222, 223, 224, 225, 226, 227, 228, 234, 239, 243, 244, 245], "structur": [1, 77], "from": [1, 3, 4, 5, 72, 88, 89, 91, 92, 96, 105, 113, 124, 128, 130, 131, 132, 133, 135, 138, 145, 159, 161, 162, 165, 166, 177, 179, 192, 193, 194, 199, 208, 227, 242, 243, 244], "frontend": 1, "api": 1, "redirect": 1, "when": [1, 3, 5, 6, 180, 200, 201, 223, 227, 240, 244], "appropri": 1, "fallback": 1, "metal": 1, "vjp": [1, 243], "jvp": [1, 243], "In": [1, 3, 4, 113, 128, 180, 182, 183, 184, 186, 187, 193, 199, 204, 242, 244], "one": [1, 3, 6, 57, 63, 66, 79, 80, 108, 113, 129, 131, 159, 162, 244], "sentenc": 1, "comput": [1, 2, 3, 4, 5, 6, 72, 97, 101, 110, 116, 128, 151, 154, 161, 173, 174, 175, 181, 182, 184, 185, 186, 187, 199, 204, 205, 210, 211, 213, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 239, 243, 244], "graph": [1, 3, 4, 5, 77, 144, 151], "rule": 1, "evalu": [1, 3, 4, 77, 101, 144, 175, 180, 199, 239, 243], "said": [1, 3], "start": [1, 2, 3, 5, 6, 15, 104, 156, 244], "discuss": 1, "more": [1, 4, 8, 57, 113, 199, 240, 244], "detail": [1, 8, 182, 183, 184, 186, 187, 199], "thei": [1, 2, 3, 67, 180, 187, 215, 242, 243, 244], "c": [1, 3, 196, 200, 201, 243, 244], "scalar": [1, 11, 13, 26, 37, 57, 60, 61, 63, 73, 74, 95, 96, 97, 98, 99, 102, 103, 104, 110, 111, 113, 115, 118, 120, 125, 135, 138, 139, 162, 173, 177, 181, 228, 243], "sum": [1, 2, 11, 112, 154, 199, 221, 222, 223, 224, 225, 226, 227, 228], "elementwis": 1, "numpi": [1, 3, 4, 5, 11, 13, 15, 61, 73, 74, 98, 99, 102, 103, 110, 113, 115, 118, 120, 162, 243], "style": [1, 11, 13, 73, 74, 98, 99, 102, 103, 110, 113, 115, 118, 120, 162], "broadcast": [1, 11, 13, 61, 63, 73, 74, 96, 98, 99, 102, 103, 110, 113, 115, 118, 120, 130, 131, 138, 139, 162, 166, 177, 208], "between": [1, 5, 63, 244], "input": [1, 2, 3, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 73, 74, 75, 76, 78, 79, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97, 98, 99, 101, 102, 103, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 124, 125, 126, 127, 128, 129, 137, 140, 141, 142, 143, 149, 150, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 171, 172, 173, 174, 176, 177, 179, 200, 201, 202, 204, 205, 206, 208, 210, 211, 213, 217, 221, 223, 226, 228, 234, 243], "upcast": 1, "const": 1, "factor": [1, 222], "streamordevic": 1, "stream": [1, 5, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 28, 29, 30, 31, 32, 33, 34, 36, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 51, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98, 99, 100, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 137, 138, 139, 140, 141, 142, 143, 148, 149, 150, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 177, 178, 179, 244], "schedul": [1, 244], "itself": 1, "call": [1, 3, 4, 27, 95, 180, 199, 202, 215, 239], "other": [1, 3, 180, 187, 199, 208, 243], "within": [1, 24], "simplest": [1, 199], "wai": [1, 3, 6, 199], "about": [1, 3, 4, 244], "term": [1, 182, 183, 184, 185, 186, 190], "exist": [1, 3], "auto": [1, 6], "ax": [1, 12, 14, 22, 23, 58, 79, 82, 83, 85, 86, 88, 89, 91, 92, 112, 114, 116, 117, 125, 127, 154, 159, 163, 164, 169, 174], "multipli": [1, 128], "earlier": 1, "goal": 1, "themselv": 1, "contain": [1, 3, 50, 77, 87, 88, 89, 111, 128, 156, 177, 180, 199], "act": 1, "data": [1, 4, 5, 8, 15, 80, 90, 91, 96, 100, 104, 123, 138, 170, 178], "nor": [1, 97, 173], "rather": [1, 244], "easi": [1, 199], "interfac": 1, "block": [1, 3], "A": [1, 3, 5, 6, 50, 60, 97, 101, 112, 113, 128, 130, 131, 132, 134, 135, 138, 139, 156, 160, 173, 175, 176, 180, 181, 184, 186, 192, 193, 194, 199, 204, 205, 207, 211, 215, 220, 228, 229, 239], "It": [1, 3, 6, 97, 173, 186, 188, 199, 210], "creat": [1, 3, 6, 80, 100, 180, 199, 239], "output": [1, 3, 6, 12, 13, 14, 15, 22, 23, 24, 61, 80, 87, 90, 91, 92, 96, 97, 100, 104, 112, 114, 116, 117, 123, 124, 126, 127, 130, 131, 132, 134, 135, 138, 139, 145, 146, 154, 159, 163, 166, 170, 173, 174, 175, 176, 177, 178, 179, 200, 201, 206, 208, 210, 217, 221, 222, 223, 224, 225, 226, 227, 228, 234, 243, 244], "given": [1, 12, 14, 24, 61, 63, 64, 72, 77, 79, 81, 82, 83, 84, 85, 86, 90, 91, 92, 96, 112, 114, 116, 117, 127, 135, 142, 154, 156, 163, 170, 171, 172, 174, 208], "set": [1, 3, 4, 6, 180, 189, 203, 206, 210, 213, 217, 228, 234, 240], "further": [1, 6], "class": [1, 3, 4, 7, 8, 9, 26, 180, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234], "under": 1, "These": [1, 166, 244], "word": 1, "bit": [1, 72, 128, 129, 196, 210], "abstract": 1, "back": [1, 3], "give": [1, 3, 4, 24], "ourselv": 1, "concret": [1, 206, 244], "imag": [1, 201], "public": [1, 199], "explicit": [1, 240], "alpha_": 1, "beta_": 1, "must": [1, 6, 63, 77, 96, 130, 131, 135, 138, 139, 177], "know": [1, 3], "popul": 1, "To": [1, 2, 3, 4, 6, 199, 243], "avoid": 1, "unnecessari": [1, 3], "alloc": [1, 180], "respons": 1, "space": [1, 104, 226], "void": 1, "eval_cpu": 1, "std": 1, "overrid": 1, "eval_gpu": 1, "jacobian": [1, 101, 175, 243], "product": [1, 101, 113, 127, 175, 208, 243], "primal": [1, 101, 175], "tangent": [1, 20, 21, 101, 167, 168], "int": [1, 3, 4, 7, 9, 12, 14, 15, 22, 23, 24, 25, 29, 30, 31, 32, 40, 41, 42, 43, 45, 48, 50, 53, 56, 57, 59, 61, 64, 65, 66, 72, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 96, 97, 100, 104, 112, 114, 116, 117, 119, 123, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 141, 142, 154, 155, 156, 159, 160, 163, 164, 165, 166, 169, 170, 171, 172, 173, 174, 176, 178, 180, 199, 200, 201, 202, 204, 205, 206, 208, 210, 211, 213, 222, 223, 226, 228], "argnum": [1, 97, 173], "cotan": 1, "across": [1, 204], "pair": [1, 125, 213], "repres": [1, 3, 228], "axi": [1, 3, 4, 12, 14, 22, 23, 24, 25, 29, 30, 31, 32, 40, 41, 42, 43, 45, 53, 56, 59, 64, 79, 81, 84, 87, 88, 89, 90, 91, 92, 112, 114, 116, 117, 119, 125, 126, 127, 131, 154, 155, 156, 159, 160, 163, 164, 165, 166, 169, 174, 176, 222, 223, 226, 228], "correspond": [1, 12, 14, 63, 72, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 112, 114, 117, 127, 163, 176, 193], "dimens": [1, 3, 12, 14, 22, 23, 44, 50, 57, 66, 79, 88, 89, 91, 92, 93, 112, 113, 114, 116, 117, 127, 128, 131, 137, 163, 166, 169, 174, 200, 201, 204, 205, 208, 211, 213], "vmap": [1, 243], "print": [1, 2, 3, 4, 6, 192, 193, 194, 199, 240, 243], "ostream": 1, "os": [1, 6], "equival": [1, 27, 47, 58, 95, 203, 210], "check": [1, 6, 60], "bool": [1, 12, 14, 22, 23, 29, 30, 31, 32, 40, 41, 42, 43, 45, 56, 57, 59, 60, 77, 112, 114, 116, 117, 127, 130, 135, 138, 139, 144, 163, 174, 191, 200, 201, 204, 205, 206, 208, 210, 213], "is_equival": 1, "privat": 1, "fall": 1, "eval": [1, 2, 3, 4, 151, 180, 199, 239, 243], "deriv": 1, "base": [1, 77, 107, 109, 180, 186, 188, 213, 239, 240], "abov": [1, 3, 6, 128, 171, 185, 199, 244], "demonstr": 1, "treat": [1, 60, 88, 89, 91, 92, 165], "paramet": [1, 2, 3, 4, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 33, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 190, 191, 192, 193, 194, 200, 201, 202, 203, 204, 205, 206, 208, 210, 211, 213, 215, 217, 221, 222, 223, 224, 225, 226, 227, 228, 234, 235, 239], "produc": [1, 208], "through": [1, 161, 187], "construct": [1, 4, 96, 123, 178], "its": [1, 6, 113, 126, 137, 151, 170, 181, 184, 185, 186, 194, 199, 210, 244], "type": [1, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 33, 50, 57, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139, 140, 141, 142, 143, 149, 150, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 188, 192, 199, 221, 222, 223, 224, 225, 226, 227, 228], "shape": [1, 3, 4, 47, 60, 61, 65, 66, 81, 84, 87, 90, 91, 92, 96, 101, 113, 123, 124, 130, 131, 132, 134, 135, 138, 139, 141, 166, 175, 177, 178, 179, 199, 200, 201, 206, 228, 239, 243, 244], "pass": [1, 3, 4, 47, 58, 125, 173, 181, 192, 193, 199, 210, 215], "re": [1, 4], "now": [1, 3, 210], "promot": 1, "dtype": [1, 3, 15, 26, 33, 57, 80, 96, 100, 104, 123, 132, 134, 135, 138, 139, 170, 178, 196, 221, 243], "promoted_dtyp": 1, "promote_typ": 1, "float32": [1, 15, 80, 100, 104, 123, 132, 134, 138, 139, 170, 178, 196, 221, 243], "non": [1, 6, 180, 207, 229], "point": [1, 2, 3, 6, 95, 129, 196], "out_dtyp": 1, "is_floating_point": 1, "cast": [1, 33, 90, 91, 92], "up": [1, 3, 210], "determin": 1, "x_cast": 1, "astyp": [1, 3], "y_cast": 1, "broadcasted_input": 1, "broadcast_arrai": 1, "out_shap": 1, "0": [1, 2, 3, 4, 6, 7, 15, 48, 53, 59, 64, 65, 66, 80, 93, 97, 125, 130, 139, 142, 156, 160, 170, 171, 172, 173, 174, 176, 180, 182, 184, 185, 186, 187, 190, 191, 192, 199, 200, 201, 203, 204, 205, 209, 212, 214, 217, 219, 220, 221, 222, 227, 228, 230, 231, 232, 234, 240, 243], "unique_ptr": 1, "make_uniqu": 1, "to_stream": 1, "handl": [1, 199], "resolv": 1, "No": [1, 3], "happen": [1, 3, 239], "alon": 1, "effect": 1, "onli": [1, 3, 5, 6, 60, 65, 66, 128, 180, 196, 199, 244], "execut": [1, 6, 244], "depend": [1, 2, 57, 244], "devic": [1, 5, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 28, 29, 30, 31, 32, 33, 34, 36, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 51, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98, 99, 100, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 137, 138, 139, 140, 141, 142, 143, 147, 149, 150, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 177, 178, 179, 244, 245], "specifi": [1, 15, 33, 66, 88, 89, 96, 97, 104, 119, 123, 131, 164, 165, 166, 169, 173, 176, 178, 217, 221, 222, 223, 224, 225, 226, 227, 228, 234, 244], "memori": [1, 5, 151, 180], "ha": [1, 3, 4, 5, 57, 87, 88, 90, 91, 92, 97, 131, 180, 206, 239, 243, 244], "been": [1, 3], "try": [1, 6], "naiv": 1, "gener": [1, 2, 15, 80, 88, 89, 104, 130, 134, 135, 138, 139, 240, 245], "version": [1, 6, 72, 110, 112, 128, 154, 176, 240], "declar": 1, "member": [1, 199], "method": [1, 3, 7, 8, 9, 26, 180, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 199], "each": [1, 50, 72, 77, 113, 125, 128, 129, 131, 145, 146, 156, 169, 176, 177, 202, 204, 213, 222, 240], "element": [1, 10, 11, 16, 17, 18, 19, 20, 21, 24, 62, 68, 69, 72, 73, 74, 75, 76, 78, 80, 94, 95, 98, 99, 102, 103, 106, 107, 108, 109, 110, 111, 115, 118, 120, 121, 126, 128, 129, 140, 143, 149, 150, 152, 153, 157, 158, 162, 165, 167, 168, 173, 177, 207, 213, 216, 229, 230, 233], "find": [1, 2, 6], "pointwis": 1, "captur": [1, 199], "templat": 1, "axpby_impl": 1, "typenam": 1, "t": [1, 3, 75, 173, 182, 183, 184, 185, 186, 187, 190, 191, 199, 244], "readi": 1, "fill": [1, 96, 124, 170, 179], "malloc_or_wait": 1, "synchron": 1, "avail": [1, 2, 3, 4, 6, 8, 196, 244], "There": [1, 199], "wait": [1, 3], "here": [1, 3, 230, 244], "request": 1, "pressur": 1, "condit": [1, 177, 244], "set_data": 1, "nbyte": 1, "collect": [1, 189, 193, 242], "pointer": 1, "x_ptr": 1, "y_ptr": 1, "out_ptr": 1, "relev": 1, "static_cast": 1, "size_t": 1, "out_idx": 1, "size": [1, 3, 4, 50, 66, 72, 79, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 96, 100, 128, 129, 131, 141, 156, 159, 199, 200, 201, 202, 210], "map": [1, 4, 105, 193, 202], "linear": [1, 3, 4, 5, 180, 193, 199, 203, 210, 212, 214, 216, 218, 219, 220, 231, 232, 233], "indic": [1, 13, 22, 23, 24, 25, 77, 97, 156, 165, 166, 173, 222], "offset": [1, 3], "x_offset": 1, "elem_to_loc": 1, "stride": [1, 65, 66, 200, 201, 213], "y_offset": 1, "contigu": 1, "regularli": 1, "default": [1, 6, 12, 14, 15, 22, 23, 24, 25, 60, 64, 65, 66, 72, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 97, 100, 104, 112, 114, 116, 117, 123, 126, 127, 128, 129, 130, 131, 132, 134, 135, 137, 138, 139, 141, 142, 144, 155, 156, 159, 160, 163, 169, 170, 171, 172, 173, 174, 176, 178, 180, 182, 183, 184, 185, 186, 187, 189, 190, 191, 196, 200, 201, 206, 208, 210, 213, 221, 222, 223, 224, 225, 226, 227, 228, 240, 242, 245], "row": [1, 80, 100, 128, 170], "major": 1, "henc": [1, 128], "doesn": [1, 199], "additon": 1, "abl": [1, 128], "all": [1, 4, 6, 13, 24, 66, 77, 80, 83, 86, 89, 92, 113, 125, 126, 159, 180, 188, 199, 208, 210, 240, 243, 245], "incom": 1, "accordingli": 1, "dispatch": 1, "float16": [1, 196], "bfloat16": 1, "complex64": 1, "throw": 1, "error": [1, 6, 75, 76, 156, 203, 210, 218, 219, 220, 225], "encount": 1, "unexpect": [1, 15], "regist": [1, 4], "op": 1, "contruct": 1, "assert": 1, "2": [1, 2, 3, 4, 66, 75, 82, 85, 87, 88, 89, 90, 91, 92, 109, 113, 128, 137, 170, 171, 172, 180, 182, 183, 184, 185, 190, 196, 199, 201, 203, 211, 219, 227, 228, 243, 244], "1": [1, 3, 4, 15, 24, 25, 65, 66, 81, 82, 84, 85, 87, 88, 89, 90, 91, 92, 93, 113, 126, 128, 131, 139, 149, 155, 165, 173, 180, 182, 183, 184, 185, 186, 187, 190, 191, 196, 199, 200, 201, 203, 204, 205, 209, 211, 213, 214, 217, 219, 220, 221, 222, 223, 226, 227, 228, 232, 234, 239, 243, 244], "correct": [1, 184, 185, 186], "els": [1, 3, 199], "float16_t": 1, "bfloat16_t": 1, "complex64_t": 1, "runtime_error": 1, "support": [1, 3, 5, 6, 13, 65, 66, 113, 128], "have": [1, 3, 6, 60, 88, 89, 91, 92, 113, 131, 187, 192, 208, 215, 242, 244], "rememb": 1, "3": [1, 3, 6, 187, 240, 243], "complic": 1, "keep": [1, 12, 14, 22, 23, 112, 114, 116, 117, 127, 163, 174, 199], "mind": [1, 3], "half": [1, 15, 135, 139, 213], "precis": [1, 3, 199, 203], "direct": [1, 3, 187, 244], "fix": [1, 3, 6], "possibl": [1, 3, 113, 156, 202, 244], "due": 1, "transpos": [1, 3, 27], "aren": 1, "guarante": 1, "fit": [1, 128, 244], "requir": [1, 3, 199], "column": [1, 80, 100, 128], "inplac": 1, "expect": [1, 3, 200, 201, 208], "answer": 1, "copi": [1, 3, 5, 126, 155], "simpli": [1, 3, 6, 180, 212, 231], "catlas_saxpbi": 1, "axpby_impl_acceler": 1, "first": [1, 2, 3, 4, 6, 93, 97, 113, 126, 137, 164, 173, 184, 185, 186, 192, 199, 204, 244], "mode": [1, 67], "i": [1, 3, 101, 185, 199, 200, 201], "e": [1, 4, 6, 75, 101, 149, 183, 200, 201, 204, 205, 211, 235, 239, 245], "match": [1, 6, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92], "transposit": 1, "data_s": 1, "items": 1, "flag": 1, "copy_inplac": 1, "copytyp": 1, "n": [1, 3, 26, 65, 66, 80, 81, 83, 84, 86, 87, 90, 92, 100, 170, 174, 200, 201, 228], "incx": 1, "inci": 1, "great": 1, "But": [1, 244], "criteria": 1, "luckili": 1, "alwai": [1, 192], "With": 1, "final": [1, 2, 3, 4], "singl": [1, 4, 77, 101, 125, 175], "row_contigu": 1, "col_contigu": 1, "common": 1, "hit": 1, "mileston": 1, "enough": 1, "run": [1, 3, 4, 5, 6, 151, 182, 184, 185, 186, 244, 245], "If": [1, 3, 6, 12, 14, 15, 22, 23, 24, 25, 57, 60, 63, 64, 67, 77, 90, 91, 92, 95, 96, 97, 112, 113, 114, 116, 117, 123, 125, 126, 127, 131, 144, 154, 155, 156, 163, 165, 166, 173, 174, 176, 178, 193, 200, 201, 204, 205, 206, 208, 210, 213, 215, 228, 244, 245], "plan": 1, "stop": [1, 3, 15, 104, 161], "enjoi": 1, "speed": 1, "appl": [1, 3, 5, 6, 244], "silicon": [1, 3, 5, 6, 244], "address": 1, "shade": 1, "languag": [1, 196], "kernel": [1, 65, 66], "written": 1, "help": [1, 3, 244], "resourc": 1, "walkthrough": 1, "pipelin": 1, "specif": [1, 6], "cpp": 1, "algorithm": [1, 187], "launch": 1, "exactli": [1, 3], "mani": [1, 156, 200, 201, 202, 208], "thread": 1, "pick": 1, "updat": [1, 2, 3, 4, 185, 187, 191, 193, 239], "assign": [1, 180], "axpby_gener": 1, "buffer": 1, "constant": [1, 3, 6, 125, 190, 204, 205, 211, 228], "4": [1, 3, 72, 128, 129, 145, 196, 210, 243, 244], "5": [1, 2, 3, 6, 130, 190, 227], "x_stride": 1, "6": [1, 3, 145, 190, 219, 220, 228, 243], "y_stride": 1, "7": [1, 3, 128], "ndim": 1, "8": [1, 3, 6, 128, 182, 183, 184, 185, 186, 190, 196, 243, 244], "uint": 1, "index": [1, 7, 9, 24, 79, 80, 97, 126, 165, 166, 173], "thread_position_in_grid": 1, "convert": [1, 57, 210, 243], "instanti": [1, 4], "uniqu": [1, 240], "host": 1, "name": [1, 105, 128, 145, 146, 189, 199, 204], "identifi": [1, 192, 242], "instantiate_axpbi": 1, "type_nam": 1, "host_nam": 1, "axpby_general_": 1, "bflot16": 1, "compil": [1, 6], "mlx_ext": 1, "metallib": [1, 6], "see": [1, 3, 4, 6, 8, 28, 29, 30, 31, 32, 34, 36, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 51, 53, 54, 55, 56, 58, 59, 199, 203, 210, 214, 218, 219, 220, 232, 244], "later": [1, 6], "co": 1, "locat": [1, 244], "share": [1, 5, 72, 128, 129], "register_librari": 1, "potenti": 1, "path": [1, 6, 145, 146], "tri": 1, "load": [1, 4], "hasn": 1, "alreadi": [1, 3], "static": [1, 6], "object": [1, 8, 26, 37, 57, 130, 135, 138, 139, 176, 192, 193, 242], "why": [1, 3], "packag": [1, 2, 4], "process": [1, 3, 67, 193, 202, 242], "logic": [1, 111], "grid": 1, "shown": 1, "below": [1, 170, 172, 196], "prepar": [1, 3], "carri": 1, "should": [1, 2, 3, 4, 6, 77, 101, 128, 151, 166, 173, 175, 180, 192, 199, 200, 201, 208, 215, 242, 245], "d": [1, 3, 113, 165, 170, 171, 172, 182, 184, 186, 194, 244], "ostringstream": 1, "kname": 1, "axpby_": 1, "general_": 1, "type_to_nam": 1, "make": [1, 3, 4, 6, 113, 199, 243, 244], "sure": [1, 3, 6, 199], "look": [1, 3], "folder": 1, "get_colocated_mtllib_path": 1, "get_kernel": 1, "str": [1, 67, 97, 105, 144, 145, 146, 173, 192, 194, 221, 222, 223, 224, 225, 226, 227, 228], "encod": [1, 213], "compute_encod": 1, "get_command_encod": 1, "setcomputepipelinest": 1, "those": [1, 3, 199], "decelar": 1, "nelem": 1, "set_array_buff": 1, "setbyt": 1, "sizeof": 1, "threadgroup": 1, "higher": 1, "than": [1, 3, 57, 67, 98, 99, 102, 103, 113, 187, 193, 213, 217, 227, 234, 244], "max": [1, 115, 186, 228, 230, 244], "allow": [1, 180, 188, 199, 243], "tgp_size": 1, "min": [1, 118, 230], "maxtotalthreadsperthreadgroup": 1, "3d": 1, "mtl": 1, "group_dim": 1, "grid_dim": 1, "divd": 1, "among": 1, "dispatchthread": 1, "few": [1, 3, 4, 5, 151, 243], "thing": [1, 3], "note": [1, 3, 6, 13, 65, 66, 88, 89, 128, 131, 199], "befor": [1, 3, 6, 24, 126, 144], "move": [1, 119, 244], "track": [1, 199], "activ": [1, 6, 207, 217, 229, 234, 235], "command": [1, 6], "instead": [1, 199], "end_encod": 1, "end": [1, 128, 214, 217, 227, 232, 234], "until": [1, 243], "limit": [1, 63], "flush": 1, "enqueu": 1, "commit": 1, "associ": [1, 145, 146], "suggest": 1, "deeper": 1, "dive": 1, "studi": 1, "come": [1, 3], "far": [1, 239], "built": [1, 6], "includ": [1, 210, 243, 245], "forward": [1, 173], "diff": 1, "push": 1, "along": [1, 22, 23, 64, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 154, 156, 160, 165, 166, 199], "primtiv": 1, "similarli": [1, 6, 113], "scale_arr": 1, "contribut": 1, "tangent_x": 1, "tangent_i": 1, "revers": [1, 169], "arg": [1, 3, 8, 47, 58, 77, 145, 146, 151], "push_back": 1, "fulli": [1, 5, 244], "primitv": 1, "overal": 1, "directori": [1, 3, 6], "extens": [1, 196], "h": [1, 65, 66, 201], "mlx_sample_extens": 1, "__init__": [1, 3, 4, 7, 8, 9, 26, 180, 199], "py": [1, 3, 6], "cmakelist": 1, "txt": 1, "setup": [1, 2, 4, 6], "strucutr": 1, "hold": [1, 3, 8, 188], "instal": 1, "pybind11": [1, 6], "sinc": [1, 3, 4, 180, 187, 244], "compon": [1, 3], "etc": [1, 128, 199], "becom": 1, "pybind11_modul": 1, "m": [1, 6, 80, 170, 182], "doc": [1, 4], "sampl": [1, 2, 3, 104, 130, 131, 132, 135, 138, 139, 228, 240], "_a": 1, "pos_onli": 1, "kw_onli": 1, "none": [1, 3, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 36, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 51, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 176, 177, 178, 179, 192, 193, 203, 208, 221, 222, 223, 224, 225, 226, 227, 228], "r": [1, 3, 173], "pbdoc": 1, "most": [1, 131, 199], "complex": [1, 88, 89, 90, 91, 92, 130, 135, 138, 139, 192, 199], "addit": [1, 3, 11, 180, 204, 205, 208, 211], "bell": 1, "whistl": 1, "liter": 1, "string": 1, "modul": [1, 3, 4, 181, 210, 215, 242], "ensur": 1, "caster": 1, "find_packag": 1, "config": 1, "add_librari": 1, "sourc": [1, 119, 169], "target_sourc": 1, "cmake_current_list_dir": 1, "header": 1, "target_include_directori": 1, "target_link_librari": 1, "attach": 1, "conveni": [1, 4], "mlx_build_metallib": 1, "target": [1, 173, 221, 222, 223, 224, 225, 226, 227], "destin": [1, 119], "automat": [1, 5, 243, 244], "practic": 1, "mlx_build_met": [1, 6], "mlx_ext_metallib": 1, "titl": 1, "include_dir": 1, "project_source_dir": 1, "mlx_include_dir": 1, "output_directori": 1, "cmake_library_output_directori": 1, "add_depend": 1, "endif": 1, "pybind11_add_modul": 1, "build_shared_lib": 1, "target_link_opt": 1, "wl": 1, "rpath": 1, "loader_path": 1, "onc": [1, 151], "describ": 1, "util": [1, 3, 5, 6, 145, 199], "__name__": [1, 3], "__main__": [1, 3], "descript": [1, 3, 196], "ext_modul": 1, "cmakeextens": 1, "cmdclass": 1, "build_ext": 1, "cmakebuild": 1, "package_dir": 1, "package_data": 1, "dylib": 1, "zip_saf": 1, "fals": [1, 3, 12, 14, 22, 23, 29, 30, 31, 32, 40, 41, 42, 43, 45, 56, 59, 60, 77, 112, 114, 116, 117, 127, 163, 174, 177, 191, 192, 193, 196, 204, 206, 208, 210, 213], "python_requir": 1, "even": [1, 3], "though": [1, 3], "j8": 1, "libmlx_ext": 1, "cpython": 1, "3x": 1, "darwin": 1, "pip": [1, 6], "after": [1, 3, 4, 24, 95, 126, 128, 204, 205, 208, 227, 244], "plai": [1, 3], "ones": [1, 3, 124, 145, 151, 170, 210], "b": [1, 3, 11, 13, 60, 73, 74, 95, 98, 99, 102, 103, 110, 113, 115, 118, 120, 128, 162, 173, 206, 243, 244], "f": [1, 2, 4, 185, 199], "item": [1, 2, 3, 4, 193, 243], "true": [1, 2, 3, 60, 154, 177, 192, 193, 196, 199, 200, 201, 204, 205, 206, 210, 213], "quick": [1, 5], "benchmark": 1, "compar": [1, 60], "time": [1, 3, 6, 151, 199, 244], "set_default_devic": 1, "256": [1, 4], "512": [1, 3, 244], "random": [1, 2, 3, 4, 5, 244, 245], "normal": [1, 2, 3, 138, 189, 204, 205, 211, 244], "bench": 1, "warm": 1, "rang": [1, 2, 3, 4, 6, 15, 104, 219, 220, 239, 240, 244], "100": [1, 2, 3, 244], "5000": 1, "simple_tim": 1, "custom_tim": 1, "3f": [1, 4], "custom": 1, "114": 1, "109": 1, "modest": 1, "improv": [1, 3, 182, 183, 184, 185, 186, 190], "awai": [1, 3], "good": [1, 6, 244], "nn": [1, 3, 4, 145, 193, 199, 239], "grad": [1, 2, 4, 173, 239, 243], "simplifi": 1, "full": [1, 4, 47, 58, 67, 154], "implement": [2, 4, 182, 183, 184, 185, 186, 187, 188, 189, 190, 202, 208, 213, 215, 217, 234], "basic": 2, "model": [2, 4, 5, 145, 180, 181, 193, 199, 208, 239], "problem": [2, 4, 199], "metadata": 2, "num_featur": 2, "num_exampl": 2, "1_000": 2, "num_it": 2, "10_000": 2, "iter": [2, 4, 193, 240], "sgd": [2, 4, 187, 239], "lr": [2, 187], "01": [2, 185], "rate": [2, 182, 183, 184, 185, 186, 187, 190, 191], "ll": [2, 4], "synthet": 2, "dataset": 2, "matrix": [2, 72, 80, 100, 113, 128, 129, 210], "ground": [2, 3, 227], "truth": [2, 227], "w_star": 2, "valu": [2, 3, 10, 15, 22, 23, 37, 57, 60, 63, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 96, 104, 125, 130, 131, 132, 134, 135, 138, 139, 165, 166, 173, 176, 180, 181, 185, 189, 192, 193, 196, 208, 217, 221, 222, 224, 225, 226, 227, 234], "gaussian": [2, 203, 218, 219, 220], "nois": 2, "exampl": [2, 3, 4, 15, 165, 199, 221, 239, 240, 243], "noisi": 2, "label": [2, 222], "ep": [2, 182, 183, 184, 185, 186, 190, 204, 205, 211, 228], "1e": [2, 4, 13, 182, 183, 184, 185, 186, 190, 204, 205, 211, 228], "us": [2, 3, 4, 5, 6, 15, 72, 93, 113, 128, 129, 141, 180, 182, 184, 185, 186, 187, 188, 192, 199, 202, 203, 206, 208, 210, 213, 219, 220, 239, 240, 242, 243, 244], "weight": [2, 65, 66, 180, 185, 187, 191, 193, 199, 210, 222], "squar": [2, 3, 100, 143, 157, 173, 182, 184, 185, 186, 193, 199, 211, 225, 227], "loss": [2, 4, 173, 199, 239], "loss_fn": [2, 4, 239], "w": [2, 66, 72, 128, 129, 173, 191, 201, 206], "mean": [2, 3, 4, 173, 199, 204, 211, 221, 222, 223, 224, 225, 226, 227, 228], "grad_fn": 2, "initi": [2, 3, 180, 199, 204, 205, 211], "randomli": [2, 3], "Then": [2, 6], "repeatedli": 2, "_": [2, 3, 199, 240, 244], "verifi": 2, "close": [2, 5, 13], "error_norm": 2, "5f": 2, "someth": [2, 3], "00005": 2, "00364": 2, "complet": [2, 3, 6, 244], "logist": [2, 149, 216, 219, 220, 233], "github": [2, 4, 6], "repo": [2, 4, 6], "enabl": [3, 6, 77, 191], "larg": [3, 199], "ish": 3, "transform": [3, 5, 77, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 144, 181, 199, 204, 205, 206, 210], "compromis": 3, "eas": 3, "llama": 3, "famili": 3, "less": [3, 24, 103, 126, 213, 227], "200": 3, "line": 3, "python": [3, 37, 50, 57, 77, 180, 192, 193, 194, 242], "neural": [3, 5, 180, 190, 202, 207, 229], "network": [3, 5, 180, 190, 202], "build": [3, 5, 180], "concis": 3, "architectur": [3, 199, 244], "notabl": 3, "rope": [3, 199], "posit": [3, 24, 97, 119, 126, 173, 193, 199, 200, 201, 208, 213, 228], "option": [3, 12, 14, 15, 22, 23, 24, 25, 26, 31, 32, 64, 65, 66, 67, 72, 77, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 96, 97, 100, 104, 112, 114, 116, 117, 123, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 137, 138, 139, 141, 144, 154, 155, 156, 159, 160, 163, 165, 166, 169, 170, 171, 172, 173, 174, 176, 178, 182, 183, 184, 185, 186, 187, 190, 191, 192, 193, 200, 201, 206, 208, 210, 213, 221, 222, 223, 224, 225, 226, 227, 228, 240, 245], "kei": [3, 130, 131, 132, 134, 135, 137, 138, 139, 189, 192, 193, 208, 240, 242], "cach": 3, "concaten": 3, "project": [3, 208], "llamaattent": 3, "self": [3, 4, 7, 9, 26, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 51, 53, 54, 55, 56, 57, 58, 59, 180, 199, 207, 229], "dim": [3, 202, 204, 205, 208, 211, 213], "num_head": [3, 208], "super": [3, 4, 180, 199], "tradit": [3, 213], "query_proj": 3, "bia": [3, 72, 128, 129, 184, 185, 186, 193, 199, 200, 201, 206, 208, 210], "key_proj": 3, "value_proj": 3, "out_proj": [3, 180], "__call__": [3, 4, 180, 199], "queri": [3, 208], "mask": [3, 208], "extract": [3, 180, 199], "l": [3, 4, 199, 200, 227], "reshap": 3, "combin": 3, "key_cach": 3, "value_cach": 3, "sqrt": [3, 75, 182, 183, 184, 185, 190, 204, 205, 211], "score": 3, "softmax": [3, 222], "values_hat": 3, "rm": 3, "swiglu": 3, "rmsnorm": [3, 199], "llamaencoderlay": 3, "mlp_dim": 3, "norm1": 3, "norm2": 3, "linear1": 3, "linear2": 3, "linear3": 3, "sigmoid": [3, 216, 219, 220, 221, 233], "instanc": [3, 128, 180, 194, 199, 215], "embed": [3, 199], "emb": [3, 202], "token": [3, 202], "num_lay": [3, 4, 239], "vocab_s": 3, "norm": [3, 186, 187, 204, 228], "multiheadattent": [3, 199], "create_additive_causal_mask": 3, "list": [3, 8, 12, 14, 26, 29, 30, 40, 41, 42, 43, 45, 50, 53, 56, 57, 59, 61, 64, 77, 79, 82, 83, 85, 86, 88, 89, 91, 92, 96, 97, 101, 112, 114, 116, 117, 123, 125, 127, 130, 131, 132, 134, 135, 138, 139, 141, 154, 156, 159, 160, 163, 169, 173, 174, 175, 178, 180, 184, 185, 186, 187, 192, 194, 199, 242], "still": [3, 6], "consid": [3, 13, 60, 192, 193, 204, 242], "train": [3, 4], "ignor": [3, 63], "whatsoev": 3, "rest": [3, 193, 213], "subsect": 3, "prompt": 3, "autoregress": 3, "yield": [3, 4, 240], "temp": 3, "causal": 3, "save": [3, 105, 128, 145, 146], "append": [3, 113], "store": 3, "per": [3, 4, 72, 128, 129, 188, 204, 205, 211], "care": 3, "last": [3, 25, 57, 83, 86, 88, 89, 91, 92, 93, 113, 131, 155, 200, 201, 204], "logit": [3, 131, 221, 222], "next": [3, 4], "categor": 3, "lazili": [3, 199], "noth": [3, 199], "yet": [3, 180, 199, 243], "forc": [3, 4, 199, 243], "choos": [3, 213], "pars": 3, "feed": 3, "loop": [3, 4], "unsqueez": 3, "sequenc": [3, 200, 240, 244], "length": [3, 159, 200], "len": [3, 83, 86, 89, 92], "overwrit": 3, "discard": [3, 192], "old": 3, "moment": [3, 184, 185, 186], "anymor": 3, "everyth": 3, "small": [3, 151, 204, 205, 211, 228, 244], "10": [3, 4, 107, 142, 145, 151, 193, 199], "12": 3, "8192": 3, "1024": 3, "actual": [3, 15, 180], "materi": [3, 5], "could": [3, 199], "20_000": 3, "machin": [3, 5, 6, 190], "8gb": 3, "ram": 3, "32": [3, 4, 128, 129, 196], "44": 3, "doubl": 3, "bracket": 3, "becaus": [3, 199], "batch": [3, 113, 200, 201, 208], "zip": [3, 4], "haven": 3, "anyth": [3, 173], "result": [3, 15, 57, 72, 105, 113, 129, 142, 160, 177, 193], "similar": [3, 193, 208], "runtim": 3, "section": [3, 156, 228], "access": [3, 37, 180, 199, 244], "origin": [3, 182, 183, 184, 186, 187], "sentencepiec": 3, "pytorch": [3, 5, 204], "compat": [3, 131], "npz": [3, 105, 145, 146], "file": [3, 6, 105, 144, 145, 146], "directli": 3, "argpars": 3, "itertool": [3, 193], "starmap": [3, 193], "np": [3, 4, 243], "torch": 3, "map_torch_to_mlx": 3, "tok_embed": 3, "elif": 3, "replac": [3, 227], "attention_norm": 3, "ffn_norm": 3, "wq": 3, "wk": 3, "wv": 3, "wo": 3, "w1": 3, "w2": 3, "w3": 3, "ffn": 3, "separ": [3, 47, 58, 204], "submodul": [3, 4, 199], "feed_forward": 3, "parser": 3, "argumentpars": 3, "add_argu": 3, "torch_weight": 3, "output_fil": 3, "parse_arg": 3, "state": [3, 4, 188, 189, 199, 239, 240], "savez": 3, "k": [3, 80, 170, 171, 172], "v": [3, 67, 199], "left": [3, 128, 203, 213, 219, 220, 228], "disk": 3, "text": [3, 187, 207, 214, 217, 227, 228, 229, 230, 232, 234], "format": [3, 105, 144, 145, 146], "oper": [3, 5, 33, 151, 154, 161, 166, 187, 199, 243, 244, 245], "dictionari": [3, 188, 189, 192, 199, 242], "represent": [3, 128, 192, 194], "tree_unflatten": 3, "helper": 3, "weight_fil": 3, "incur": 3, "sever": [3, 65, 66, 145, 146], "futur": [3, 210], "pth": 3, "current": [3, 5, 6, 65, 66, 128, 199], "around": 3, "m1": [3, 244], "ultra": 3, "7b": 3, "me": 3, "ishmael": 3, "year": 3, "ago": 3, "never": 3, "long": 3, "info": 3, "247": 3, "press": 3, "enter": 3, "littl": 3, "monei": 3, "my": [3, 6], "purs": 3, "greater": [3, 24, 99, 126, 217, 234], "consequ": 3, "walk": 3, "down": 3, "gower": 3, "street": 3, "afternoon": 3, "heavi": 3, "rain": 3, "saw": 3, "off": [3, 6], "man": 3, "rag": 3, "who": 3, "sat": 3, "upon": [3, 193], "hi": 3, "bundl": 3, "hard": 3, "wet": 3, "he": 3, "were": [3, 244], "cry": 3, "watch": 3, "him": 3, "observ": 3, "numer": [3, 110, 112, 154, 182, 183, 184, 185, 186, 190, 204, 205, 211, 228], "crowd": 3, "wa": [3, 189], "hurri": 3, "437": 3, "330": 3, "second": [3, 113, 164, 173, 184, 185, 186, 244], "spent": 3, "amount": 3, "39": 3, "ms": 3, "By": 3, "bigger": 3, "remain": [3, 173], "almost": 3, "nobodi": 3, "took": 3, "least": [3, 63, 128], "notic": 3, "distanc": [3, 228], "had": 3, "doubt": 3, "minut": 3, "straight": 3, "slowli": 3, "rais": [3, 156], "ey": 3, "speak": 3, "resum": 3, "postur": 3, "stood": 3, "feel": 3, "pain": 3, "heart": 3, "smile": 3, "face": 3, "am": 3, "someon": 3, "three": 3, "quarter": 3, "hour": 3, "made": 3, "immedi": 3, "repli": 3, "again": [3, 199], "hand": 3, "did": 3, "accustom": 3, "thu": [3, 199], "question": 3, "reason": 3, "tell": 3, "understand": 3, "579": 3, "690": 3, "num": [3, 104, 137], "500": [3, 244], "628": 3, "went": 3, "nervou": 3, "trembl": 3, "told": 3, "And": 3, "perhap": 3, "surpris": 3, "matter": [3, 199], "shall": 3, "anyhow": 3, "friend": 3, "ye": 3, "slight": 3, "kind": 3, "longer": [3, 67], "soon": 3, "unless": [3, 180], "unlik": [3, 13], "strang": 3, "amus": 3, "That": 3, "secret": 3, "disappoint": 3, "mine": 3, "cannot": [3, 63], "happi": 3, "ask": 3, "Is": 3, "shop": 3, "bui": 3, "food": 3, "633": 3, "21": 3, "475": 3, "su": 3, "j": [3, 6, 183, 184, 186], "lu": 3, "pan": 3, "murtadha": 3, "wen": 3, "liu": 3, "2021": 3, "roform": 3, "enhanc": 3, "rotari": [3, 213], "arxiv": [3, 182, 187, 204, 205, 207, 211, 213, 229], "preprint": [3, 182, 187], "2104": [3, 213], "09864": [3, 213], "zhang": 3, "sennrich": 3, "2019": [3, 185], "root": [3, 143, 157, 211], "advanc": 3, "inform": [3, 4, 199, 203, 208, 244], "system": 3, "shazeer": 3, "2020": 3, "glu": 3, "variant": [3, 186, 227], "2002": 3, "05202": 3, "classifi": 4, "mnist": 4, "As": [4, 165, 199], "mlp": [4, 199, 239], "inherit": [4, 242], "standard": [4, 37, 57, 113, 132, 243], "idiom": 4, "input_dim": [4, 199, 206, 210], "hidden_dim": [4, 180, 239], "output_dim": [4, 199, 206, 210], "layer_s": 4, "idim": 4, "odim": 4, "maximum": [4, 22, 63, 180, 199, 212, 219, 220, 231], "cross": [4, 221, 222], "entropi": [4, 221, 222], "sub": [4, 137], "commonli": 4, "cross_entropi": [4, 199], "accuraci": 4, "valid": [4, 67, 176, 192, 242], "eval_fn": 4, "argmax": 4, "loader": 4, "num_class": [4, 239], "batch_siz": [4, 239], "num_epoch": [4, 239], "learning_r": [4, 182, 183, 184, 185, 186, 187, 190, 191, 239], "train_imag": [4, 239], "train_label": [4, 239], "test_imag": 4, "test_label": 4, "shuffl": 4, "minibatch": 4, "batch_iter": [4, 239], "perm": 4, "permut": 4, "id": [4, 6], "put": 4, "trainabl": [4, 180, 181, 199], "loss_and_grad_fn": [4, 239], "value_and_grad": [4, 180, 199, 239, 243], "epoch": 4, "test": [4, 6], "confus": 4, "decent": 4, "95": 4, "brought": 5, "research": 5, "except": [5, 80, 87, 88, 90, 91, 92, 204], "featur": [5, 65, 66, 204, 205, 206, 210, 211, 213], "main": [5, 80, 193, 199], "differ": [5, 162, 227], "lazi": [5, 180, 243], "multi": [5, 200, 201], "cpu": [5, 244], "gpu": [5, 244], "inspir": 5, "jax": [5, 240], "arrayfir": 5, "noteabl": 5, "unifi": 5, "live": [5, 244], "guid": 5, "regress": 5, "layer": [5, 180, 199, 204, 205, 206, 210, 215, 235], "perceptron": 5, "llm": 5, "infer": [5, 96], "fft": 5, "tree": [5, 77, 97, 151, 173, 176, 188, 192, 193, 194], "develop": [5, 6], "document": [5, 47, 58], "meet": 6, "seri": 6, "chip": 6, "nativ": 6, "maco": 6, "13": 6, "recommend": [6, 187], "14": 6, "sonoma": 6, "distribut": [6, 130, 131, 132, 134, 138, 139, 223, 226, 228], "probabl": [6, 135, 210, 223, 244], "platform": 6, "processor": 6, "arm": [6, 196], "i386": 6, "switch": 6, "conda": 6, "17": 6, "g": [6, 128, 190, 191, 235, 245], "clang": 6, "cmake": 6, "24": 6, "xcode": 6, "15": 6, "clone": 6, "git": 6, "com": 6, "ml": 6, "explor": 6, "cd": 6, "brew": 6, "global": [6, 136, 240], "env": 6, "cmake_build_parallel_level": 6, "edit": 6, "unittest": 6, "discov": 6, "stub": 6, "dev": 6, "generate_stub": 6, "mkdir": 6, "p": [6, 130, 184, 186, 199, 228], "either": [6, 11, 47, 57, 58, 63, 73, 74, 95, 98, 99, 102, 103, 110, 113, 115, 118, 120, 162, 173, 215], "libmlx": 6, "preprocessor": 6, "metal_path": 6, "mlx_build_test": 6, "ON": 6, "mlx_build_exampl": 6, "mlx_build_benchmark": 6, "mlx_build_python_bind": 6, "multipl": [6, 113, 120, 128, 129, 208], "wish": 6, "environ": 6, "variabl": [6, 97, 101, 173, 175, 176], "export": 6, "developer_dir": 6, "app": 6, "content": 6, "sdk": 6, "xcrun": 6, "macosx": 6, "show": [6, 196], "unabl": 6, "tool": 6, "select": [6, 177], "sudo": 6, "devicetyp": 7, "attribut": [7, 8, 9, 26, 180], "kwarg": [8, 145, 146, 245], "union": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 36, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 51, 53, 54, 55, 56, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 137, 138, 139, 140, 141, 142, 143, 149, 150, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 177, 178, 179, 201], "wise": [10, 11, 16, 17, 18, 19, 20, 21, 62, 68, 69, 73, 74, 75, 76, 78, 94, 95, 98, 99, 102, 103, 106, 107, 108, 109, 110, 111, 115, 118, 120, 121, 140, 143, 149, 150, 152, 153, 157, 158, 162, 167, 168, 207, 216, 229, 230, 233], "absolut": [10, 13, 219, 220, 227], "semant": [11, 61, 73, 74, 98, 99, 102, 103, 110, 113, 115, 118, 120, 162, 244], "keepdim": [12, 14, 22, 23, 29, 30, 31, 32, 40, 41, 42, 43, 45, 56, 59, 112, 114, 116, 117, 127, 154, 163, 174], "reduct": [12, 14, 112, 114, 117, 127, 221, 222, 223, 224, 225, 226, 227, 228], "reduc": [12, 14, 22, 23, 112, 114, 116, 117, 127, 151, 163, 174], "unspecifi": [12, 14, 15, 22, 23, 24, 25, 64, 96, 112, 114, 116, 117, 123, 126, 127, 154, 155, 163, 165, 174, 178, 245], "entir": [12, 14, 22, 23, 112, 114, 116, 117, 127, 163, 174], "singleton": [12, 14, 22, 23, 112, 113, 114, 116, 117, 127, 163, 174], "rtol": 13, "05": [13, 204, 205, 211], "atol": 13, "08": [13, 183, 184, 185, 186, 190], "approxim": [13, 151, 203, 218, 219, 220], "comparison": [13, 74, 98, 99, 102, 103], "equal": [13, 24, 60, 80, 99, 103, 126, 135, 156], "ab": [13, 173, 204, 205, 207, 211, 213, 229], "array_equ": 13, "rel": 13, "toler": 13, "boolean": [13, 60, 111, 196], "interv": [15, 104, 135, 139], "increment": 15, "otherwis": [15, 192, 193, 217, 227, 234], "int32": [15, 135, 196, 243], "convent": [15, 67, 185], "lead": 15, "fraction": 15, "integr": [15, 165], "invers": [16, 17, 18, 19, 20, 21, 76, 84, 85, 86, 87, 88, 89], "cosin": [16, 17, 68, 69], "hyperbol": [17, 19, 21, 69, 153, 168], "sine": [18, 19, 152, 153], "minimum": [22, 23, 63], "kth": [24, 126], "partit": 24, "order": [24, 126, 128, 199, 204, 215], "undefin": [24, 126], "sort": [24, 25, 126], "partiton": 24, "flatten": [24, 25, 126, 155, 165, 166, 192], "dimension": [26, 81, 82, 83, 84, 85, 86, 90, 91, 92, 200, 201, 202, 206, 210], "val": [26, 96], "tupl": [26, 47, 58, 64, 66, 77, 79, 101, 125, 128, 141, 159, 173, 175, 184, 185, 186, 187, 192, 193, 194, 201, 215, 242], "ndarrai": [26, 243], "properti": [27, 35, 44, 50, 52], "argument": [27, 47, 58, 77, 97, 144, 173, 193, 199, 240, 244, 245], "elment": 52, "indices_or_sect": [53, 156], "nest": [57, 180, 199, 242], "correpsond": 57, "ddof": [59, 174], "equal_nan": 60, "nan": 60, "pad": [65, 66, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 200, 201], "dilat": [65, 66], "group": [65, 66, 72, 128, 129, 204, 210], "1d": [65, 67, 166], "convolut": [65, 66, 67, 200, 201], "channel": [65, 66, 200, 201], "c_in": [65, 66], "c_out": [65, 66], "convolv": [65, 66], "2d": [66, 128], "spatial": [66, 204], "symmetr": 66, "discret": [67, 81, 82, 83, 84, 85, 86, 90, 91, 92, 202], "swap": [67, 164, 210], "conv": 67, "filter": [67, 200, 201], "flip": 67, "signal": 67, "divis": [73, 95, 128], "quotient": [73, 95], "mathrm": [75, 149], "frac": [75, 128, 149, 182, 183, 184, 185, 186, 190, 204, 205, 211], "pi": 75, "int_0": 75, "dx": 75, "erf": 76, "retain_graph": [77, 144], "node": [77, 151, 176], "dict": [77, 105, 145, 180, 242], "leaf": [77, 192, 193], "preserv": [77, 141], "intend": 77, "control": [77, 240], "flow": [77, 161], "exponenti": [78, 214, 232], "insert": [79, 244], "ident": [80, 161], "diagon": [80, 170, 171, 172], "zero": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 170, 171, 172, 179, 199], "th": 80, "whose": [80, 181], "One": [81, 84, 90, 143], "fourier": [81, 82, 83, 84, 85, 86, 90, 91, 92], "truncat": [81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 138], "dft": [81, 82, 83, 84, 85, 86, 90, 91, 92], "rfft": 87, "real": [87, 88, 89, 90, 91, 92], "rfft2": 88, "rfftn": 89, "silent": [90, 91, 92], "start_axi": 93, "end_axi": 93, "fun": [97, 101, 173, 175, 176, 244], "argnam": [97, 173], "cpp_function": [97, 173, 176], "neither": [97, 173], "keyword": [97, 145, 146, 173, 193, 199, 240, 245], "strict": [98, 102], "binari": [105, 144, 145, 146, 217, 221, 234], "npy": [105, 144], "natur": [106, 108], "logarithm": [106, 107, 108, 109], "log": [108, 110, 112, 223, 226], "plu": 108, "exp": [110, 112, 132, 154, 214, 223, 232, 244], "stabl": [110, 112, 154], "prepend": 113, "remov": [113, 131, 159], "anoth": [63, 113, 162, 177, 199, 244], "negat": 121, "pad_with": 125, "constant_valu": 125, "pad_width": 125, "edg": [63, 125], "before_1": 125, "after_1": 125, "before_2": 125, "after_2": 125, "before_n": 125, "after_n": 125, "integ": [95, 125, 128, 129, 130, 135, 156, 176, 196, 202], "before_i": 125, "after_i": 125, "extend": 125, "side": 125, "smaller": [126, 187], "prng": [130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 240], "num_sampl": 131, "unnorm": [131, 221, 222], "draw": 131, "uint32": [131, 196], "cdf": [132, 203, 218], "accord": [132, 177, 208], "seed": 133, "low": [135, 139], "high": [135, 139, 199, 202], "lower": [128, 135, 138, 139, 170], "upper": [128, 135, 138, 139], "bound": [135, 138, 139, 203, 244], "roadcast": 135, "domain": 138, "optino": 138, "uniformli": 139, "reciproc": 143, "arr": 144, "retain": 144, "dure": 144, "uncompress": 145, "my_path": 145, "tree_flatten": [145, 193, 194, 199], "transformerencod": 145, "128": [145, 199], "flat_param": 145, "compress": 146, "simplif": 151, "reus": 151, "consumpt": 151, "meant": 151, "everi": [128, 151, 193], "overhead": [151, 244], "1m": 151, "thousand": 151, "foo": 151, "matmul": [151, 244], "twice": [151, 244], "subarrai": 156, "being": [161, 199], "prevent": [161, 228], "unchang": [161, 213], "axis1": 164, "axis2": 164, "taken": 165, "prior": [165, 166], "equial": 165, "exclud": 166, "elsewher": 170, "col": 170, "triangl": 170, "mse": 173, "param": [173, 199], "lvalu": 173, "dlvalu": 173, "dparam": 173, "lasso": 173, "l1": [173, 224, 227], "varianc": [174, 204], "divisor": 174, "cotang": 175, "in_ax": 176, "out_ax": 176, "prefix": [176, 192], "subclass": 180, "arbitrari": [180, 192], "recurs": [180, 189, 199], "concept": 180, "frozen": [180, 199, 210], "freez": [180, 199], "mymlp": 180, "in_dim": [180, 199], "out_dim": [180, 199], "16": [180, 196], "in_proj": 180, "fn": [181, 193, 243], "callabl": [181, 192, 193, 215], "wrt": 181, "rho": 182, "9": [182, 184, 185, 186, 187], "06": [182, 228], "paper": [182, 183, 184, 186, 187], "zeiler": 182, "2012": [182, 190], "adapt": [182, 183], "1212": 182, "5701": 182, "v_": [182, 183, 184, 185, 186, 190, 191], "v_t": [182, 183, 184, 185, 186, 190, 191], "g_t": [182, 183, 184, 185, 186, 187, 190, 191], "delta": 182, "w_": [182, 183, 184, 185, 186, 187, 190, 191], "u_t": 182, "epsilon": [182, 183, 184, 185, 186, 190, 204, 205, 211], "u_": 182, "w_t": [182, 183, 184, 185, 186, 187, 190, 191], "lambda": [182, 183, 184, 185, 186, 187, 190, 191, 193, 199, 214, 232], "coeffici": [182, 184, 185, 186, 187], "averag": [182, 184, 185, 186], "denomin": [182, 183, 184, 185, 186, 190], "stabil": [182, 183, 184, 185, 186, 190, 204, 205, 211], "ddefault": 182, "duchi": 183, "hazan": 183, "singer": 183, "2011": 183, "subgradi": 183, "onlin": 183, "stochast": [183, 184, 186, 191], "jmlr": 183, "999": [184, 185, 186], "omit": [184, 186], "estim": [184, 186], "kingma": [184, 186], "ba": [184, 186], "2015": [184, 186], "iclr": [184, 185, 186], "m_": [184, 185, 186, 187], "beta_1": [184, 185, 186, 187], "m_t": [184, 185, 186, 187], "beta_2": [184, 185, 186, 187], "weight_decai": [185, 187, 191], "contrast": [185, 189], "loshchilov": 185, "hutter": 185, "decoupl": 185, "decai": [185, 187, 191], "regular": [185, 207, 229], "adam": [186, 187], "infin": 186, "basi": 188, "appli": [188, 193, 200, 201, 203, 204, 205, 206, 207, 210, 211, 212, 214, 216, 217, 218, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234], "optimizerst": 188, "defaultdict": 189, "miss": 189, "present": 189, "99": [187, 190], "tieleman": 190, "hinton": 190, "lectur": 190, "coursera": 190, "smooth": [190, 222, 227], "momentum": [187, 191], "dampen": 191, "nesterov": 191, "descent": 191, "mu": 191, "tau": 191, "strength": [187, 191], "l2": 191, "penalti": 191, "is_leaf": [192, 193], "dot": [192, 208], "notat": [72, 192], "depth": 192, "hello": [192, 194], "charact": 192, "flat": [192, 194], "superset": 193, "extra": 193, "closer": 193, "dict_kei": 193, "recreat": 194, "world": 194, "42": 194, "tabl": [196, 202], "byte": 196, "bool_": 196, "uint8": 196, "unsign": [128, 129, 196], "uint16": 196, "int8": 196, "sign": [187, 196], "int16": 196, "int64": 196, "64": [72, 128, 129, 196, 210], "arbitrarili": [199, 242, 243], "done": 199, "manual": 199, "explicitli": [199, 240], "solv": 199, "intuit": 199, "finetun": 199, "enumer": 199, "caus": 199, "local": 199, "scope": 199, "l2_loss": 199, "y_hat": 199, "trainable_paramet": 199, "loss_and_grad": 199, "workhors": 199, "Its": 199, "individu": 199, "subset": 199, "action": 199, "displai": 199, "tree_map": 199, "count": 199, "num_param": 199, "preclud": 199, "pure": [199, 239], "pattern": 199, "achiev": 199, "other_input": 199, "necessari": 199, "wrap": 199, "relu": 199, "prelu": 199, "gelu": [199, 219, 220], "silu": 199, "selu": 199, "mish": 199, "conv1d": 199, "conv2d": 199, "layernorm": 199, "groupnorm": 199, "sequenti": 199, "gelu_approx": [199, 203, 218], "gelu_fast_approx": [199, 203, 218], "binary_cross_entropi": 199, "l1_loss": 199, "mse_loss": 199, "nll_loss": 199, "kl_div_loss": 199, "in_channel": [200, 201], "out_channel": [200, 201], "kernel_s": [200, 201], "nlc": 200, "learnabl": [200, 201, 215], "nhwc": 201, "height": 201, "width": [201, 210], "num_embed": 202, "lookup": 202, "typic": [202, 239], "usual": [202, 242], "vocabulari": 202, "approx": 203, "unit": [203, 212, 214, 216, 218, 219, 220, 231, 232, 233], "textrm": [128, 203, 218], "phi": [203, 218], "geluapprox": 203, "sigma": [203, 216, 219, 220, 233], "60033": [203, 219], "0433603": [203, 219], "gelufast": 203, "773": [203, 220], "regard": 203, "num_group": 204, "affin": [204, 205, 206, 210], "pytorch_compat": 204, "var": [204, 205], "gamma": [204, 205, 211], "particular": [128, 204], "split": 204, "preced": 204, "http": [204, 205, 207, 211, 213, 229], "org": [204, 205, 207, 211, 213, 229], "1803": 204, "08494": 204, "1607": 205, "06450": 205, "monoton": [207, 229], "refer": [207, 229], "1908": [207, 229], "08681": [207, 229], "tanh": [207, 229], "softplu": [207, 229], "query_input_dim": 208, "key_input_dim": 208, "value_input_dim": 208, "value_dim": 208, "value_output_dim": 208, "attent": 208, "head": 208, "aggreg": 208, "linearli": 208, "bias": [72, 128, 129, 208], "inf": 208, "neg": [208, 226, 228], "attend": 208, "num_paramet": 209, "init": 209, "25": 209, "1910": 211, "07467": 211, "rectifi": [212, 231], "10000": 213, "rotat": 213, "consecut": [128, 213], "larger": [187, 213], "slightli": [213, 244], "angular": 213, "frequenc": 213, "begin": [128, 214, 217, 227, 232, 234], "leq": [214, 232], "0507": [214, 232], "67326": [214, 232], "elu": [214, 232], "plain": 215, "known": [216, 233], "swish": [216, 233], "cdot": [216, 219, 220, 233], "threshold": [217, 227, 234], "geq": [217, 234], "faster": 218, "exact": [219, 220], "0003": 219, "015": 220, "predict": [221, 222, 223, 224, 225, 226, 227], "post": [], "612192": 221, "kullback": 223, "leibler": 223, "diverg": 223, "likelihood": 226, "nll": 226, "subsequ": 239, "implicit": 240, "fine": 240, "grain": 240, "manag": [240, 244], "uniform": [240, 244], "pseudo": 240, "altern": 240, "splittabl": 240, "threefri": 240, "counter": 240, "cycl": 242, "inspect": 243, "composit": 243, "sin": 243, "pool": 244, "advantag": 244, "don": 244, "parallel": 244, "race": 244, "interest": 244, "albeit": 244, "contriv": 244, "suppos": 244, "d1": 244, "d2": 244, "4096": 244, "dens": 244, "better": 244, "millisecond": 244, "measur": 244, "default_stream": 245, "default_devic": 245, "my_devic": 245, "decim": [48, 142], "a_min": 63, "a_max": 63, "At": 63, "group_siz": [72, 128, 129, 210], "configur": 72, "formal": [72, 128], "quantiz": [72, 129, 210], "w_i": [72, 128], "hat": [72, 128], "occupi": [72, 128, 129], "floor": 95, "divid": [95, 128], "50": 104, "evenli": 104, "w_1": 128, "w_g": 128, "align": 128, "max_i": 128, "min_i": 128, "round": 128, "pack": [128, 129], "1st": 128, "signific": 128, "2nd": 128, "dequant": 128, "w_q": 128, "bascial": 142, "tend": 187, "10x": 187, "adamw": 187, "maintain": 187, "wd": 187, "chen": 187, "symbol": 187, "discoveri": 187, "2302": 187, "06675": 187, "c_": 187, "eta": 187, "c_t": 187, "constitut": 193, "quantizedlinear": 199, "smooth_l1_loss": 199, "triplet_loss": 199, "chang": [210, 227], "classmethod": 210, "from_linear": 210, "quantize_modul": 210, "pre": 221, "105361": 221, "223144": 221, "20397": 221, "916291": 221, "label_smooth": 222, "formula": 227, "anchor": 228, "margin": 228, "triplet": 228, "l_": 228, "_p": 228, "degre": 228, "pairwis": 228, "instabl": 228, "tensor": 228}, "objects": {"mlx.core": [[7, 0, 1, "", "Device"], [8, 0, 1, "", "Dtype"], [9, 0, 1, "", "Stream"], [10, 2, 1, "", "abs"], [11, 2, 1, "", "add"], [12, 2, 1, "", "all"], [13, 2, 1, "", "allclose"], [14, 2, 1, "", "any"], [15, 2, 1, "", "arange"], [16, 2, 1, "", "arccos"], [17, 2, 1, "", "arccosh"], [18, 2, 1, "", "arcsin"], [19, 2, 1, "", "arcsinh"], [20, 2, 1, "", "arctan"], [21, 2, 1, "", "arctanh"], [22, 2, 1, "", "argmax"], [23, 2, 1, "", "argmin"], [24, 2, 1, "", "argpartition"], [25, 2, 1, "", "argsort"], [26, 0, 1, "", "array"], [60, 2, 1, "", "array_equal"], [61, 2, 1, "", "broadcast_to"], [62, 2, 1, "", "ceil"], [63, 2, 1, "", "clip"], [64, 2, 1, "", "concatenate"], [65, 2, 1, "", "conv1d"], [66, 2, 1, "", "conv2d"], [67, 2, 1, "", "convolve"], [68, 2, 1, "", "cos"], [69, 2, 1, "", "cosh"], [70, 2, 1, "", "default_device"], [71, 2, 1, "", "default_stream"], [72, 2, 1, "", "dequantize"], [73, 2, 1, "", "divide"], [74, 2, 1, "", "equal"], [75, 2, 1, "", "erf"], [76, 2, 1, "", "erfinv"], [77, 2, 1, "", "eval"], [78, 2, 1, "", "exp"], [79, 2, 1, "", "expand_dims"], [80, 2, 1, "", "eye"], [93, 2, 1, "", "flatten"], [94, 2, 1, "", "floor"], [95, 2, 1, "", "floor_divide"], [96, 2, 1, "", "full"], [97, 2, 1, "", "grad"], [98, 2, 1, "", "greater"], [99, 2, 1, "", "greater_equal"], [100, 2, 1, "", "identity"], [101, 2, 1, "", "jvp"], [102, 2, 1, "", "less"], [103, 2, 1, "", "less_equal"], [104, 2, 1, "", "linspace"], [105, 2, 1, "", "load"], [106, 2, 1, "", "log"], [107, 2, 1, "", "log10"], [108, 2, 1, "", "log1p"], [109, 2, 1, "", "log2"], [110, 2, 1, "", "logaddexp"], [111, 2, 1, "", "logical_not"], [112, 2, 1, "", "logsumexp"], [113, 2, 1, "", "matmul"], [114, 2, 1, "", "max"], [115, 2, 1, "", "maximum"], [116, 2, 1, "", "mean"], [117, 2, 1, "", "min"], [118, 2, 1, "", "minimum"], [119, 2, 1, "", "moveaxis"], [120, 2, 1, "", "multiply"], [121, 2, 1, "", "negative"], [122, 2, 1, "", "new_stream"], [123, 2, 1, "", "ones"], [124, 2, 1, "", "ones_like"], [125, 2, 1, "", "pad"], [126, 2, 1, "", "partition"], [127, 2, 1, "", "prod"], [128, 2, 1, "", "quantize"], [129, 2, 1, "", "quantized_matmul"], [140, 2, 1, "", "reciprocal"], [141, 2, 1, "", "reshape"], [142, 2, 1, "", "round"], [143, 2, 1, "", "rsqrt"], [144, 2, 1, "", "save"], [145, 2, 1, "", "savez"], [146, 2, 1, "", "savez_compressed"], [147, 2, 1, "", "set_default_device"], [148, 2, 1, "", "set_default_stream"], [149, 2, 1, "", "sigmoid"], [150, 2, 1, "", "sign"], [151, 2, 1, "", "simplify"], [152, 2, 1, "", "sin"], [153, 2, 1, "", "sinh"], [154, 2, 1, "", "softmax"], [155, 2, 1, "", "sort"], [156, 2, 1, "", "split"], [157, 2, 1, "", "sqrt"], [158, 2, 1, "", "square"], [159, 2, 1, "", "squeeze"], [160, 2, 1, "", "stack"], [161, 2, 1, "", "stop_gradient"], [162, 2, 1, "", "subtract"], [163, 2, 1, "", "sum"], [164, 2, 1, "", "swapaxes"], [165, 2, 1, "", "take"], [166, 2, 1, "", "take_along_axis"], [167, 2, 1, "", "tan"], [168, 2, 1, "", "tanh"], [169, 2, 1, "", "transpose"], [170, 2, 1, "", "tri"], [171, 2, 1, "", "tril"], [172, 2, 1, "", "triu"], [173, 2, 1, "", "value_and_grad"], [174, 2, 1, "", "var"], [175, 2, 1, "", "vjp"], [176, 2, 1, "", "vmap"], [177, 2, 1, "", "where"], [178, 2, 1, "", "zeros"], [179, 2, 1, "", "zeros_like"]], "mlx.core.Device": [[7, 1, 1, "", "__init__"]], "mlx.core.Dtype": [[8, 1, 1, "", "__init__"]], "mlx.core.Stream": [[9, 1, 1, "", "__init__"]], "mlx.core.array": [[27, 3, 1, "", "T"], [26, 1, 1, "", "__init__"], [28, 1, 1, "", "abs"], [29, 1, 1, "", "all"], [30, 1, 1, "", "any"], [31, 1, 1, "", "argmax"], [32, 1, 1, "", "argmin"], [33, 1, 1, "", "astype"], [34, 1, 1, "", "cos"], [35, 3, 1, "", "dtype"], [36, 1, 1, "", "exp"], [37, 1, 1, "", "item"], [38, 1, 1, "", "log"], [39, 1, 1, "", "log1p"], [40, 1, 1, "", "logsumexp"], [41, 1, 1, "", "max"], [42, 1, 1, "", "mean"], [43, 1, 1, "", "min"], [44, 3, 1, "", "ndim"], [45, 1, 1, "", "prod"], [46, 1, 1, "", "reciprocal"], [47, 1, 1, "", "reshape"], [48, 1, 1, "", "round"], [49, 1, 1, "", "rsqrt"], [50, 3, 1, "", "shape"], [51, 1, 1, "", "sin"], [52, 3, 1, "", "size"], [53, 1, 1, "", "split"], [54, 1, 1, "", "sqrt"], [55, 1, 1, "", "square"], [56, 1, 1, "", "sum"], [57, 1, 1, "", "tolist"], [58, 1, 1, "", "transpose"], [59, 1, 1, "", "var"]], "mlx.core.fft": [[81, 2, 1, "", "fft"], [82, 2, 1, "", "fft2"], [83, 2, 1, "", "fftn"], [84, 2, 1, "", "ifft"], [85, 2, 1, "", "ifft2"], [86, 2, 1, "", "ifftn"], [87, 2, 1, "", "irfft"], [88, 2, 1, "", "irfft2"], [89, 2, 1, "", "irfftn"], [90, 2, 1, "", "rfft"], [91, 2, 1, "", "rfft2"], [92, 2, 1, "", "rfftn"]], "mlx.core.random": [[130, 2, 1, "", "bernoulli"], [131, 2, 1, "", "categorical"], [132, 2, 1, "", "gumbel"], [133, 2, 1, "", "key"], [134, 2, 1, "", "normal"], [135, 2, 1, "", "randint"], [136, 2, 1, "", "seed"], [137, 2, 1, "", "split"], [138, 2, 1, "", "truncated_normal"], [139, 2, 1, "", "uniform"]], "mlx.nn": [[200, 0, 1, "", "Conv1d"], [201, 0, 1, "", "Conv2d"], [202, 0, 1, "", "Embedding"], [203, 0, 1, "", "GELU"], [204, 0, 1, "", "GroupNorm"], [205, 0, 1, "", "LayerNorm"], [206, 0, 1, "", "Linear"], [207, 0, 1, "", "Mish"], [180, 0, 1, "", "Module"], [208, 0, 1, "", "MultiHeadAttention"], [209, 0, 1, "", "PReLU"], [210, 0, 1, "", "QuantizedLinear"], [211, 0, 1, "", "RMSNorm"], [212, 0, 1, "", "ReLU"], [213, 0, 1, "", "RoPE"], [214, 0, 1, "", "SELU"], [215, 0, 1, "", "Sequential"], [216, 0, 1, "", "SiLU"], [217, 0, 1, "", "Step"], [218, 0, 1, "", "gelu"], [219, 0, 1, "", "gelu_approx"], [220, 0, 1, "", "gelu_fast_approx"], [229, 0, 1, "", "mish"], [230, 0, 1, "", "prelu"], [231, 0, 1, "", "relu"], [232, 0, 1, "", "selu"], [233, 0, 1, "", "silu"], [234, 0, 1, "", "step"], [181, 2, 1, "", "value_and_grad"]], "mlx.nn.Module": [[180, 1, 1, "", "__init__"]], "mlx.nn.losses": [[221, 0, 1, "", "binary_cross_entropy"], [222, 0, 1, "", "cross_entropy"], [223, 0, 1, "", "kl_div_loss"], [224, 0, 1, "", "l1_loss"], [225, 0, 1, "", "mse_loss"], [226, 0, 1, "", "nll_loss"], [227, 0, 1, "", "smooth_l1_loss"], [228, 0, 1, "", "triplet_loss"]], "mlx.optimizers": [[182, 0, 1, "", "AdaDelta"], [183, 0, 1, "", "Adagrad"], [184, 0, 1, "", "Adam"], [185, 0, 1, "", "AdamW"], [186, 0, 1, "", "Adamax"], [187, 0, 1, "", "Lion"], [188, 0, 1, "", "Optimizer"], [189, 0, 1, "", "OptimizerState"], [190, 0, 1, "", "RMSprop"], [191, 0, 1, "", "SGD"]], "mlx.optimizers.Optimizer": [[188, 4, 1, "", "state"]], "mlx.utils": [[192, 2, 1, "", "tree_flatten"], [193, 2, 1, "", "tree_map"], [194, 2, 1, "", "tree_unflatten"]]}, "objtypes": {"0": "py:class", "1": "py:method", "2": "py:function", "3": "py:property", "4": "py:attribute"}, "objnames": {"0": ["py", "class", "Python class"], "1": ["py", "method", "Python method"], "2": ["py", "function", "Python function"], "3": ["py", "property", "Python property"], "4": ["py", "attribute", "Python attribute"]}, "titleterms": {"oper": [0, 1, 238], "develop": 1, "document": 1, "introduc": 1, "exampl": [1, 5, 244], "primit": 1, "us": [1, 245], "implement": [1, 3], "cpu": 1, "backend": 1, "gpu": 1, "transform": [1, 241, 243], "build": [1, 6], "bind": 1, "python": [1, 5, 6], "cmake": 1, "setuptool": 1, "usag": [1, 5], "result": 1, "script": [1, 3], "download": [1, 3], "code": [1, 3], "linear": [2, 206], "regress": 2, "llm": 3, "infer": 3, "model": 3, "attent": 3, "layer": [3, 4, 236], "encod": 3, "full": [3, 96], "gener": 3, "put": 3, "all": [3, 12, 29], "togeth": 3, "convert": 3, "weight": 3, "load": [3, 105], "benchmark": 3, "multi": 4, "perceptron": 4, "mlx": [5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234], "instal": [5, 6], "api": [5, 6], "refer": 5, "c": [5, 6], "further": 5, "read": 5, "from": 6, "pypi": 6, "troubleshoot": 6, "sourc": 6, "requir": 6, "option": 6, "metal": 6, "found": 6, "core": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179], "devic": [7, 197], "dtype": [8, 35], "stream": [9, 197, 245], "ab": [10, 28], "add": 11, "allclos": 13, "ani": [14, 30], "arang": 15, "arcco": 16, "arccosh": 17, "arcsin": 18, "arcsinh": 19, "arctan": 20, "arctanh": 21, "argmax": [22, 31], "argmin": [23, 32], "argpartit": 24, "argsort": 25, "arrai": [26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 195], "t": 27, "astyp": 33, "co": [34, 68], "exp": [36, 78], "item": 37, "log": [38, 106], "log1p": [39, 108], "logsumexp": [40, 112], "max": [41, 114], "mean": [42, 116], "min": [43, 117], "ndim": 44, "prod": [45, 127], "reciproc": [46, 140], "reshap": [47, 141], "rsqrt": [49, 143], "shape": 50, "sin": [51, 152], "size": 52, "split": [53, 137, 156], "sqrt": [54, 157], "squar": [55, 158], "sum": [56, 163], "tolist": 57, "transpos": [58, 169], "var": [59, 174], "array_equ": 60, "broadcast_to": 61, "ceil": 62, "concaten": 64, "conv1d": [65, 200], "conv2d": [66, 201], "convolv": 67, "cosh": 69, "default_devic": 70, "default_stream": 71, "divid": 73, "equal": 74, "erf": 75, "erfinv": 76, "eval": 77, "expand_dim": 79, "ey": 80, "fft": [81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 198], "fft2": 82, "fftn": 83, "ifft": 84, "ifft2": 85, "ifftn": 86, "irfft": 87, "irfft2": 88, "irfftn": 89, "rfft": 90, "rfft2": 91, "rfftn": 92, "flatten": 93, "floor": 94, "grad": [97, 199], "greater": 98, "greater_equ": 99, "ident": 100, "jvp": 101, "less": 102, "less_equ": 103, "log10": 107, "log2": 109, "logaddexp": 110, "logical_not": 111, "matmul": 113, "maximum": 115, "minimum": 118, "moveaxi": 119, "multipli": 120, "neg": 121, "new_stream": 122, "ones": 123, "ones_lik": 124, "pad": 125, "partit": 126, "random": [130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 240], "bernoulli": 130, "categor": 131, "gumbel": 132, "kei": 133, "normal": 134, "randint": 135, "seed": 136, "truncated_norm": 138, "uniform": 139, "save": 144, "savez": 145, "savez_compress": 146, "set_default_devic": 147, "set_default_stream": 148, "sigmoid": 149, "sign": 150, "simplifi": 151, "sinh": 153, "softmax": 154, "sort": 155, "squeez": 159, "stack": 160, "stop_gradi": 161, "subtract": 162, "swapax": 164, "take": 165, "take_along_axi": 166, "tan": 167, "tanh": 168, "tri": 170, "tril": 171, "triu": 172, "value_and_grad": [173, 181], "vjp": 175, "vmap": 176, "where": 177, "zero": 178, "zeros_lik": 179, "nn": [180, 181, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234], "modul": [180, 199], "optim": [182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 239], "adadelta": 182, "adagrad": 183, "adam": 184, "adamw": 185, "adamax": 186, "optimizerst": 189, "rmsprop": 190, "sgd": 191, "util": [192, 193, 194, 242], "tree_flatten": 192, "tree_map": 193, "tree_unflatten": 194, "data": 196, "type": 196, "support": 196, "neural": 199, "network": 199, "quick": [199, 243], "start": [199, 243], "The": 199, "class": 199, "paramet": 199, "updat": 199, "inspect": 199, "valu": 199, "embed": 202, "gelu": [203, 218], "groupnorm": 204, "layernorm": 205, "mish": [207, 229], "multiheadattent": 208, "prelu": [209, 230], "rmsnorm": 211, "relu": [212, 231], "rope": 213, "selu": [214, 232], "sequenti": 215, "silu": [216, 233], "step": [217, 234], "gelu_approx": 219, "gelu_fast_approx": 220, "loss": [221, 222, 223, 224, 225, 226, 227, 228, 237], "binary_cross_entropi": 221, "cross_entropi": 222, "kl_div_loss": 223, "l1_loss": 224, "mse_loss": 225, "nll_loss": 226, "function": [235, 237, 243], "tree": 242, "guid": 243, "basic": 243, "graph": 243, "unifi": 244, "memori": 244, "A": 244, "simpl": 244, "specifi": 245, "round": [48, 142], "clip": 63, "dequant": 72, "floor_divid": 95, "linspac": 104, "quantiz": 128, "quantized_matmul": 129, "lion": 187, "quantizedlinear": 210, "smooth_l1_loss": 227, "triplet_loss": 228}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 6, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx": 56}}) |