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.divmod", "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.inner", "python/_autosummary/mlx.core.isinf", "python/_autosummary/mlx.core.isnan", "python/_autosummary/mlx.core.isneginf", "python/_autosummary/mlx.core.isposinf", "python/_autosummary/mlx.core.jvp", "python/_autosummary/mlx.core.less", "python/_autosummary/mlx.core.less_equal", "python/_autosummary/mlx.core.linalg.norm", "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_and", "python/_autosummary/mlx.core.logical_not", "python/_autosummary/mlx.core.logical_or", "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.outer", "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.repeat", "python/_autosummary/mlx.core.reshape", "python/_autosummary/mlx.core.round", "python/_autosummary/mlx.core.rsqrt", "python/_autosummary/mlx.core.save", "python/_autosummary/mlx.core.save_gguf", "python/_autosummary/mlx.core.save_safetensors", "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.tensordot", "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.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/linalg", "python/nn", "python/nn/_autosummary/mlx.nn.ALiBi", "python/nn/_autosummary/mlx.nn.BatchNorm", "python/nn/_autosummary/mlx.nn.Conv1d", "python/nn/_autosummary/mlx.nn.Conv2d", "python/nn/_autosummary/mlx.nn.Dropout", "python/nn/_autosummary/mlx.nn.Dropout2d", "python/nn/_autosummary/mlx.nn.Dropout3d", "python/nn/_autosummary/mlx.nn.Embedding", "python/nn/_autosummary/mlx.nn.GELU", "python/nn/_autosummary/mlx.nn.GroupNorm", "python/nn/_autosummary/mlx.nn.InstanceNorm", "python/nn/_autosummary/mlx.nn.LayerNorm", "python/nn/_autosummary/mlx.nn.Linear", "python/nn/_autosummary/mlx.nn.Mish", "python/nn/_autosummary/mlx.nn.Module.apply", "python/nn/_autosummary/mlx.nn.Module.apply_to_modules", "python/nn/_autosummary/mlx.nn.Module.children", "python/nn/_autosummary/mlx.nn.Module.eval", "python/nn/_autosummary/mlx.nn.Module.filter_and_map", "python/nn/_autosummary/mlx.nn.Module.freeze", "python/nn/_autosummary/mlx.nn.Module.leaf_modules", "python/nn/_autosummary/mlx.nn.Module.load_weights", "python/nn/_autosummary/mlx.nn.Module.modules", "python/nn/_autosummary/mlx.nn.Module.named_modules", "python/nn/_autosummary/mlx.nn.Module.parameters", "python/nn/_autosummary/mlx.nn.Module.save_weights", "python/nn/_autosummary/mlx.nn.Module.train", "python/nn/_autosummary/mlx.nn.Module.trainable_parameters", "python/nn/_autosummary/mlx.nn.Module.training", "python/nn/_autosummary/mlx.nn.Module.unfreeze", "python/nn/_autosummary/mlx.nn.Module.update", "python/nn/_autosummary/mlx.nn.Module.update_modules", "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.SinusoidalPositionalEncoding", "python/nn/_autosummary/mlx.nn.Step", "python/nn/_autosummary/mlx.nn.Transformer", "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.cosine_similarity_loss", "python/nn/_autosummary_functions/mlx.nn.losses.cross_entropy", "python/nn/_autosummary_functions/mlx.nn.losses.hinge_loss", "python/nn/_autosummary_functions/mlx.nn.losses.huber_loss", "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.log_cosh_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/nn/module", "python/ops", "python/optimizers", "python/random", "python/transforms", "python/tree_utils", "usage/function_transforms", "usage/indexing", "usage/lazy_evaluation", "usage/numpy", "usage/quick_start", "usage/saving_and_loading", "usage/unified_memory", "usage/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.divmod.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.inner.rst", "python/_autosummary/mlx.core.isinf.rst", "python/_autosummary/mlx.core.isnan.rst", "python/_autosummary/mlx.core.isneginf.rst", "python/_autosummary/mlx.core.isposinf.rst", "python/_autosummary/mlx.core.jvp.rst", "python/_autosummary/mlx.core.less.rst", "python/_autosummary/mlx.core.less_equal.rst", "python/_autosummary/mlx.core.linalg.norm.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_and.rst", "python/_autosummary/mlx.core.logical_not.rst", "python/_autosummary/mlx.core.logical_or.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.outer.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.repeat.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.save_gguf.rst", "python/_autosummary/mlx.core.save_safetensors.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.tensordot.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.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/linalg.rst", "python/nn.rst", "python/nn/_autosummary/mlx.nn.ALiBi.rst", "python/nn/_autosummary/mlx.nn.BatchNorm.rst", "python/nn/_autosummary/mlx.nn.Conv1d.rst", "python/nn/_autosummary/mlx.nn.Conv2d.rst", "python/nn/_autosummary/mlx.nn.Dropout.rst", "python/nn/_autosummary/mlx.nn.Dropout2d.rst", "python/nn/_autosummary/mlx.nn.Dropout3d.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.InstanceNorm.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.Module.apply.rst", "python/nn/_autosummary/mlx.nn.Module.apply_to_modules.rst", "python/nn/_autosummary/mlx.nn.Module.children.rst", "python/nn/_autosummary/mlx.nn.Module.eval.rst", "python/nn/_autosummary/mlx.nn.Module.filter_and_map.rst", "python/nn/_autosummary/mlx.nn.Module.freeze.rst", "python/nn/_autosummary/mlx.nn.Module.leaf_modules.rst", "python/nn/_autosummary/mlx.nn.Module.load_weights.rst", "python/nn/_autosummary/mlx.nn.Module.modules.rst", "python/nn/_autosummary/mlx.nn.Module.named_modules.rst", "python/nn/_autosummary/mlx.nn.Module.parameters.rst", "python/nn/_autosummary/mlx.nn.Module.save_weights.rst", "python/nn/_autosummary/mlx.nn.Module.train.rst", "python/nn/_autosummary/mlx.nn.Module.trainable_parameters.rst", "python/nn/_autosummary/mlx.nn.Module.training.rst", "python/nn/_autosummary/mlx.nn.Module.unfreeze.rst", "python/nn/_autosummary/mlx.nn.Module.update.rst", "python/nn/_autosummary/mlx.nn.Module.update_modules.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.SinusoidalPositionalEncoding.rst", "python/nn/_autosummary/mlx.nn.Step.rst", "python/nn/_autosummary/mlx.nn.Transformer.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.cosine_similarity_loss.rst", "python/nn/_autosummary_functions/mlx.nn.losses.cross_entropy.rst", "python/nn/_autosummary_functions/mlx.nn.losses.hinge_loss.rst", "python/nn/_autosummary_functions/mlx.nn.losses.huber_loss.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.log_cosh_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/nn/module.rst", "python/ops.rst", "python/optimizers.rst", "python/random.rst", "python/transforms.rst", "python/tree_utils.rst", "usage/function_transforms.rst", "usage/indexing.rst", "usage/lazy_evaluation.rst", "usage/numpy.rst", "usage/quick_start.rst", "usage/saving_and_loading.rst", "usage/unified_memory.rst", "usage/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.divmod", "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.inner", "mlx.core.isinf", "mlx.core.isnan", "mlx.core.isneginf", "mlx.core.isposinf", "mlx.core.jvp", "mlx.core.less", "mlx.core.less_equal", "mlx.core.linalg.norm", "mlx.core.linspace", "mlx.core.load", "mlx.core.log", "mlx.core.log10", "mlx.core.log1p", "mlx.core.log2", "mlx.core.logaddexp", "mlx.core.logical_and", "mlx.core.logical_not", "mlx.core.logical_or", "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.outer", "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.repeat", "mlx.core.reshape", "mlx.core.round", "mlx.core.rsqrt", "mlx.core.save", "mlx.core.save_gguf", "mlx.core.save_safetensors", "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.tensordot", "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.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", "Linear Algebra", "Neural Networks", "mlx.nn.ALiBi", "mlx.nn.BatchNorm", "mlx.nn.Conv1d", "mlx.nn.Conv2d", "mlx.nn.Dropout", "mlx.nn.Dropout2d", "mlx.nn.Dropout3d", "mlx.nn.Embedding", "mlx.nn.GELU", "mlx.nn.GroupNorm", "mlx.nn.InstanceNorm", "mlx.nn.LayerNorm", "mlx.nn.Linear", "mlx.nn.Mish", "mlx.nn.Module.apply", "mlx.nn.Module.apply_to_modules", "mlx.nn.Module.children", "mlx.nn.Module.eval", "mlx.nn.Module.filter_and_map", "mlx.nn.Module.freeze", "mlx.nn.Module.leaf_modules", "mlx.nn.Module.load_weights", "mlx.nn.Module.modules", "mlx.nn.Module.named_modules", "mlx.nn.Module.parameters", "mlx.nn.Module.save_weights", "mlx.nn.Module.train", "mlx.nn.Module.trainable_parameters", "mlx.nn.Module.training", "mlx.nn.Module.unfreeze", "mlx.nn.Module.update", "mlx.nn.Module.update_modules", "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.SinusoidalPositionalEncoding", "mlx.nn.Step", "mlx.nn.Transformer", "mlx.nn.gelu", "mlx.nn.gelu_approx", "mlx.nn.gelu_fast_approx", "mlx.nn.losses.binary_cross_entropy", "mlx.nn.losses.cosine_similarity_loss", "mlx.nn.losses.cross_entropy", "mlx.nn.losses.hinge_loss", "mlx.nn.losses.huber_loss", "mlx.nn.losses.kl_div_loss", "mlx.nn.losses.l1_loss", "mlx.nn.losses.log_cosh_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", "Module", "Operations", "Optimizers", "Random", "Transforms", "Tree Utils", "Function Transforms", "Indexing Arrays", "Lazy Evaluation", "Conversion to NumPy and Other Frameworks", "Quick Start Guide", "Saving and Loading Arrays", "Unified Memory", "Using Streams"], "terms": {"mlx": [1, 2, 3, 4, 6, 213, 282, 284, 285, 287, 288, 289, 290, 291, 292, 293, 294], "provid": [1, 3, 72, 98, 182, 187, 206, 213, 228, 233, 235, 243, 244, 245, 248, 257, 279, 282, 293, 295], "open": [1, 6, 15, 145, 149], "flexibl": [1, 5, 245], "which": [1, 3, 4, 5, 6, 15, 33, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 98, 103, 104, 105, 106, 107, 110, 112, 138, 141, 142, 151, 152, 155, 156, 157, 158, 159, 172, 173, 178, 187, 189, 190, 219, 220, 222, 228, 232, 251, 263, 265, 271, 285, 288, 289, 290, 294, 295], "user": [1, 3, 213], "mai": [1, 110, 219, 288, 289], "add": [1, 3, 80, 117, 135, 138, 216, 217, 288, 294], "special": 1, "without": [1, 3, 5, 174, 246, 279, 287, 290, 291, 294], "much": [1, 3, 290], "hassl": 1, "while": [1, 3, 6, 152, 251, 290, 291], "librari": [1, 6, 213], "suppli": 1, "effici": [1, 3, 5, 219, 251, 290, 292], "can": [1, 3, 5, 6, 11, 15, 47, 58, 73, 74, 75, 78, 99, 100, 108, 109, 110, 117, 124, 127, 129, 140, 141, 145, 148, 149, 175, 187, 213, 221, 232, 243, 253, 282, 284, 285, 287, 288, 289, 290, 291, 292, 293, 294, 295], "compos": [1, 5, 213, 288, 292], "ani": [1, 3, 5, 15, 164, 205, 206, 207, 213, 222, 228, 229, 232, 248, 257, 287, 288, 290, 292, 293, 294], "number": [1, 15, 52, 66, 72, 81, 98, 101, 107, 111, 135, 138, 139, 141, 144, 147, 149, 151, 153, 164, 182, 184, 187, 189, 190, 213, 215, 216, 217, 219, 220, 223, 224, 246, 247, 257, 285, 288, 295], "applic": [1, 6], "aris": [1, 291], "case": [1, 3, 84, 87, 88, 90, 91, 92, 93, 94, 122, 152, 172, 219, 252, 256, 271, 276, 278, 288, 292, 293, 294, 295], "where": [1, 4, 81, 138, 187, 190, 215, 216, 217, 218, 219, 220, 222, 223, 224, 225, 226, 232, 247, 249, 252, 254, 256, 258, 259, 260, 274, 276, 277, 278, 288, 289], "new": [1, 4, 61, 128, 152, 173, 183, 206, 246, 282, 284, 289, 290, 291], "function": [1, 2, 3, 4, 5, 13, 74, 76, 77, 98, 107, 110, 122, 162, 164, 187, 189, 190, 194, 206, 213, 222, 227, 229, 233, 243, 247, 253, 256, 257, 258, 259, 260, 273, 278, 284, 285, 287, 289, 290, 291, 293], "highli": [1, 6], "optim": [1, 2, 4, 5, 244, 288, 290], "ar": [1, 2, 3, 4, 5, 6, 13, 15, 60, 61, 63, 67, 81, 83, 84, 86, 87, 89, 90, 92, 93, 98, 103, 104, 105, 106, 107, 110, 112, 122, 134, 135, 136, 138, 139, 140, 141, 142, 145, 148, 149, 158, 159, 172, 173, 178, 187, 189, 190, 200, 205, 206, 215, 216, 217, 218, 219, 220, 223, 224, 225, 226, 235, 246, 248, 279, 282, 287, 288, 289, 290, 291, 292, 293, 294], "need": [1, 3, 4, 5, 60, 138, 213, 244, 245, 255, 257, 285, 288, 290, 291, 292, 294], "For": [1, 3, 6, 110, 138, 207, 213, 215, 219, 228, 233, 240, 243, 248, 251, 255, 285, 289, 290, 291, 292, 293, 294], "you": [1, 3, 4, 5, 6, 213, 255, 257, 285, 288, 289, 291, 293, 294], "design": [1, 2, 5, 285, 294], "your": [1, 3, 6, 282, 288, 290], "own": [1, 6, 291], "link": [1, 6], "top": [1, 226], "core": [1, 2, 3, 4, 213, 215, 224, 235, 238, 241, 261, 282, 284, 291, 292], "we": [1, 2, 3, 4, 72, 138, 139, 198, 200, 213, 221, 253, 285, 287, 288, 290, 294], "inner": 1, "work": [1, 3, 6, 288, 289, 290], "go": [1, 3, 288], "over": [1, 3, 4, 12, 14, 22, 23, 24, 25, 65, 66, 84, 87, 90, 93, 102, 110, 111, 121, 123, 125, 126, 136, 137, 154, 167, 168, 176, 182, 188, 215, 216, 217, 223, 225, 249, 263, 288], "simpl": [1, 3, 4, 213, 221, 279, 288, 290], "learn": [1, 2, 4, 5, 195, 196, 197, 198, 199, 200, 203, 204, 215, 223, 224, 225, 247, 249], "step": [1, 3, 4, 15, 213], "involv": [1, 284], "ad": [1, 2, 6, 195, 196, 197, 198, 199, 203, 224, 282, 290, 293], "let": [1, 2, 3, 288, 290, 291], "s": [1, 2, 3, 4, 35, 44, 72, 83, 84, 86, 87, 89, 90, 92, 93, 98, 110, 112, 125, 134, 138, 141, 153, 156, 157, 187, 188, 190, 194, 201, 213, 232, 233, 235, 239, 243, 284, 285, 288, 290, 291, 292, 293, 294], "sai": [1, 3, 290], "would": [1, 3, 289, 290, 291, 294], "like": [1, 3, 5, 133, 193, 220, 268, 288, 290, 291, 292, 294], "an": [1, 3, 4, 6, 8, 12, 14, 26, 61, 65, 66, 78, 81, 94, 97, 101, 110, 123, 126, 128, 132, 133, 135, 137, 138, 139, 151, 152, 153, 169, 172, 177, 178, 179, 182, 184, 190, 192, 193, 195, 201, 202, 205, 206, 213, 218, 223, 225, 226, 228, 246, 247, 248, 257, 259, 274, 285, 287, 288, 289, 290, 291, 292, 293, 294, 295], "take": [1, 3, 4, 98, 107, 124, 127, 133, 139, 179, 187, 189, 190, 193, 246, 285, 288, 289, 293, 294, 295], "two": [1, 11, 13, 60, 73, 75, 83, 86, 92, 99, 100, 108, 109, 117, 122, 124, 127, 129, 134, 177, 248, 262, 288, 289, 294], "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, 122, 123, 124, 125, 126, 127, 128, 129, 130, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 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, 213, 215, 228, 235, 238, 241, 247, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 278, 282, 288, 290, 291, 292, 294], "x": [1, 2, 3, 4, 76, 101, 110, 139, 142, 153, 158, 162, 164, 185, 186, 191, 200, 206, 213, 215, 222, 223, 224, 225, 226, 227, 228, 247, 249, 250, 252, 254, 255, 256, 258, 259, 260, 271, 273, 274, 275, 276, 277, 278, 282, 284, 288, 289, 290, 291, 292, 294], "y": [1, 2, 3, 4, 164, 191, 196, 213, 215, 219, 223, 224, 225, 226, 249, 264, 271, 284, 288, 290, 291], "scale": [1, 3, 72, 138, 139, 219, 220, 246, 251, 252, 255, 276], "them": [1, 3, 213, 233, 243, 294], "both": [1, 11, 73, 74, 75, 99, 100, 108, 109, 110, 117, 124, 127, 129, 141, 175, 224, 284, 288, 292, 294], "some": [1, 2, 3, 4, 233, 243, 288, 290], "coeffici": [1, 195, 197, 198, 199, 200], "alpha": [1, 138, 198, 203, 252, 272, 274, 276], "beta": [1, 72, 138, 197, 198, 199, 200, 215, 223, 224, 225, 271], "respect": [1, 2, 4, 98, 138, 187, 206, 213, 215, 222, 223, 224, 225, 282, 288, 292], "togeth": [1, 4, 138, 206], "get": [1, 2, 4, 6, 66, 143, 202, 213, 288, 290, 294], "z": [1, 164, 290], "well": [1, 3, 213, 233, 243, 246, 290], "veri": [1, 3, 246, 290, 294], "easili": 1, "do": [1, 3, 6, 198, 213, 234, 243, 282, 288, 290], "just": [1, 4, 289], "write": [1, 3, 213, 291], "out": [1, 6, 219, 220, 240, 288, 289], "follow": [1, 3, 4, 5, 6, 15, 67, 72, 110, 138, 195, 196, 197, 198, 199, 200, 204, 213, 259, 260, 266, 285, 288, 294], "import": [1, 2, 3, 4, 6, 110, 158, 164, 187, 205, 206, 207, 213, 215, 224, 235, 261, 282, 288, 289, 290, 291, 292], "mx": [1, 2, 3, 4, 110, 112, 158, 164, 187, 213, 215, 224, 228, 235, 250, 261, 262, 266, 275, 282, 284, 285, 288, 289, 290, 291, 292, 293, 294, 295], "def": [1, 2, 3, 4, 164, 187, 213, 282, 288, 289, 290, 291, 294], "simple_axpbi": 1, "float": [1, 13, 15, 57, 96, 97, 110, 139, 140, 145, 148, 149, 195, 196, 197, 198, 199, 200, 203, 204, 209, 215, 218, 219, 220, 223, 224, 225, 228, 249, 251, 255, 256, 257, 262, 263, 265, 271, 272, 278], "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, 77, 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, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 147, 148, 149, 150, 151, 152, 153, 154, 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, 205, 206, 207, 213, 230, 232, 234, 236, 237, 238, 241, 248, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 282, 287, 288, 289, 290, 291, 293, 294], "thi": [1, 3, 4, 6, 12, 13, 14, 15, 22, 23, 24, 25, 107, 110, 117, 121, 122, 123, 125, 126, 136, 137, 141, 164, 167, 168, 169, 176, 178, 188, 213, 218, 219, 220, 229, 230, 232, 233, 236, 237, 238, 241, 243, 244, 245, 246, 248, 256, 259, 260, 268, 278, 282, 287, 288, 290, 291, 293], "perform": [1, 3, 5, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 122, 139, 153, 167, 178, 213, 223, 257, 289, 290, 294], "leav": [1, 206], "differenti": [1, 5], "howev": [1, 213, 222, 223, 285, 290, 291], "vector": [1, 2, 5, 102, 107, 110, 178, 189, 190, 221, 292], "math": [1, 3, 272], "often": [1, 220], "realiz": 1, "axpbi": 1, "routin": 1, "defin": [1, 2, 3, 4, 6, 110, 139, 202, 205, 291], "same": [1, 3, 6, 60, 61, 66, 67, 88, 91, 92, 93, 98, 107, 135, 141, 153, 189, 191, 213, 215, 218, 223, 224, 248, 272, 282, 285, 289, 294], "realli": 1, "part": [1, 288, 289], "doe": [1, 3, 6, 213, 289, 290, 291], "fast": [1, 164, 222, 260, 294], "so": [1, 3, 6, 98, 164, 187, 218, 284, 290, 294], "decid": [1, 206, 232], "want": [1, 3, 288, 294], "reli": 1, "acceler": [1, 215], "framework": [1, 5], "continu": [1, 288], "impos": 1, "our": [1, 3, 4, 195, 196, 197, 199, 200, 253], "assumpt": 1, "also": [1, 3, 4, 5, 6, 11, 73, 74, 75, 84, 87, 90, 93, 99, 100, 108, 109, 117, 124, 127, 129, 138, 175, 194, 202, 213, 232, 244, 246, 248, 252, 254, 258, 276, 277, 279, 284, 288, 289, 290, 291, 292, 295], "assum": [1, 3, 206, 213, 223], "how": [1, 3, 4, 213, 216, 217, 221, 289, 294], "gradient": [1, 2, 4, 98, 174, 187, 194, 195, 197, 198, 199, 200, 204, 213, 233, 244, 248, 268, 282, 284, 288, 289, 290, 291, 292], "ins": 1, "what": [1, 3, 206], "coincid": 1, "right": [1, 6, 138, 222, 259, 260, 265, 272], "place": [1, 3, 153, 290, 291], "cours": [1, 288], "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, 77, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 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, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 147, 148, 149, 150, 151, 152, 156, 157, 162, 163, 165, 166, 167, 168, 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, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 209, 215, 216, 217, 218, 219, 220, 221, 223, 224, 225, 226, 229, 235, 244, 245, 246, 248, 249, 251, 253, 255, 256, 257, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 278, 282, 284, 288, 289, 290, 291, 292, 293, 294, 295], "structur": [1, 288], "from": [1, 3, 4, 5, 72, 89, 90, 92, 93, 97, 110, 112, 122, 133, 138, 140, 141, 142, 143, 145, 148, 158, 172, 174, 175, 178, 179, 191, 193, 205, 206, 207, 213, 226, 233, 235, 246, 271, 287, 288, 290, 291, 292, 293, 294], "frontend": 1, "api": [1, 288], "redirect": 1, "when": [1, 3, 5, 6, 110, 112, 216, 217, 266, 271, 282, 285, 294], "appropri": 1, "fallback": 1, "metal": 1, "vjp": [1, 292], "jvp": [1, 292], "In": [1, 3, 4, 122, 138, 195, 196, 197, 199, 200, 206, 213, 219, 223, 282, 287, 288, 290, 293, 294], "one": [1, 3, 6, 57, 63, 66, 80, 81, 110, 115, 122, 139, 141, 172, 175, 243, 294], "sentenc": 1, "comput": [1, 2, 3, 4, 5, 6, 72, 98, 107, 110, 117, 125, 134, 138, 164, 167, 174, 182, 187, 188, 189, 194, 195, 197, 198, 199, 200, 213, 215, 223, 224, 225, 233, 244, 248, 249, 251, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 284, 288, 292, 294], "graph": [1, 3, 4, 5, 164, 288], "rule": 1, "evalu": [1, 3, 4, 5, 78, 107, 189, 213, 231, 240, 282, 284, 292], "said": [1, 3], "start": [1, 2, 3, 5, 6, 15, 111, 169, 289, 294], "discuss": 1, "more": [1, 4, 8, 57, 122, 156, 157, 213, 215, 219, 251, 255, 285, 288, 289, 292, 294], "detail": [1, 8, 195, 196, 197, 199, 200, 213, 219, 251, 255, 289, 292], "thei": [1, 2, 3, 67, 200, 253, 264, 282, 287, 290, 292, 293, 294], "c": [1, 3, 110, 209, 215, 216, 217, 219, 220, 224, 291, 292, 294], "scalar": [1, 11, 13, 26, 37, 57, 60, 61, 63, 73, 74, 75, 96, 97, 98, 99, 100, 108, 109, 110, 111, 117, 118, 119, 120, 122, 124, 127, 129, 135, 145, 148, 149, 175, 187, 191, 194, 272, 288, 290, 292], "sum": [1, 2, 11, 102, 110, 121, 167, 182, 213, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 289, 291], "element": [1, 10, 11, 16, 17, 18, 19, 20, 21, 24, 52, 62, 68, 69, 72, 73, 74, 75, 76, 77, 79, 81, 95, 96, 99, 100, 103, 104, 105, 106, 108, 109, 113, 114, 115, 116, 117, 118, 119, 120, 124, 127, 129, 130, 136, 138, 139, 150, 151, 154, 162, 163, 165, 166, 170, 171, 175, 178, 180, 181, 187, 191, 218, 219, 220, 227, 247, 251, 254, 273, 274, 277, 288], "wise": [1, 10, 11, 16, 17, 18, 19, 20, 21, 62, 68, 69, 73, 74, 75, 76, 77, 79, 95, 96, 99, 100, 108, 109, 113, 114, 115, 116, 117, 118, 119, 120, 124, 127, 129, 130, 150, 154, 162, 163, 165, 166, 170, 171, 175, 180, 181, 219, 220, 227, 247, 254, 273, 274, 277], "numpi": [1, 3, 4, 5, 11, 13, 15, 61, 73, 74, 75, 99, 100, 108, 109, 117, 122, 124, 127, 129, 175, 290, 292, 293], "style": [1, 11, 13, 73, 74, 75, 99, 100, 108, 109, 117, 122, 124, 127, 129, 175], "broadcast": [1, 11, 13, 61, 63, 73, 74, 75, 97, 99, 100, 108, 109, 117, 122, 124, 127, 129, 140, 141, 148, 149, 175, 179, 191, 246], "between": [1, 5, 63, 257, 262, 264, 265, 268, 290, 294], "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, 77, 79, 80, 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, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 133, 134, 135, 136, 137, 138, 139, 147, 150, 151, 152, 153, 154, 162, 163, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 185, 186, 187, 188, 190, 191, 193, 215, 216, 217, 219, 220, 221, 223, 224, 225, 226, 246, 248, 249, 251, 256, 257, 261, 262, 264, 265, 266, 268, 270, 272, 278, 288, 289, 292, 293], "upcast": 1, "const": 1, "factor": [1, 263], "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, 77, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 105, 106, 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, 144, 145, 147, 148, 149, 150, 151, 152, 153, 154, 161, 162, 163, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 188, 191, 192, 193, 294], "schedul": [1, 294], "itself": 1, "call": [1, 3, 4, 27, 96, 213, 221, 233, 243, 253, 282, 284, 288, 290], "other": [1, 3, 5, 110, 200, 213, 234, 282, 289, 290, 292], "within": [1, 24], "simplest": [1, 213], "wai": [1, 3, 6, 213, 288, 289], "about": [1, 3, 4, 290, 294], "term": [1, 195, 196, 197, 198, 199, 203], "exist": [1, 3, 233, 243], "auto": [1, 6], "ax": [1, 12, 14, 22, 23, 58, 80, 83, 84, 86, 87, 89, 90, 92, 93, 102, 110, 121, 123, 125, 126, 135, 137, 167, 172, 176, 177, 182, 183, 188, 288], "multipli": [1, 138, 139, 218, 255], "earlier": 1, "goal": 1, "themselv": 1, "contain": [1, 3, 50, 88, 89, 90, 110, 118, 119, 120, 138, 169, 191, 213, 232, 234, 235, 257, 282, 288], "act": [1, 268], "data": [1, 4, 5, 8, 15, 81, 91, 92, 97, 101, 111, 132, 148, 184, 192, 220, 289, 291], "nor": [1, 98, 187], "rather": [1, 288, 294], "easi": [1, 213], "interfac": 1, "block": [1, 3, 257], "A": [1, 3, 5, 6, 50, 60, 98, 107, 110, 112, 121, 122, 138, 140, 141, 142, 144, 145, 148, 149, 169, 173, 187, 189, 190, 194, 197, 199, 205, 206, 207, 213, 215, 219, 223, 224, 225, 227, 232, 236, 237, 244, 245, 249, 253, 255, 257, 260, 272, 273, 282, 284, 288, 290, 291], "It": [1, 3, 6, 98, 187, 199, 201, 213, 245, 248, 291, 293], "creat": [1, 3, 6, 81, 101, 213, 282, 284, 289, 291], "output": [1, 3, 6, 12, 13, 14, 15, 22, 23, 24, 61, 81, 88, 91, 92, 93, 97, 98, 101, 110, 111, 121, 123, 125, 126, 132, 133, 136, 137, 140, 141, 142, 144, 145, 148, 149, 158, 159, 167, 172, 176, 179, 184, 187, 188, 189, 190, 191, 192, 193, 215, 216, 217, 224, 226, 246, 248, 256, 257, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 278, 288, 289, 290, 291, 292, 293, 294], "given": [1, 12, 14, 24, 61, 63, 64, 72, 78, 80, 82, 83, 84, 85, 86, 87, 91, 92, 93, 97, 110, 121, 123, 125, 126, 137, 145, 153, 167, 169, 176, 184, 185, 186, 188, 218, 232, 246, 262], "set": [1, 3, 4, 6, 202, 222, 226, 231, 233, 240, 243, 244, 248, 251, 256, 262, 272, 278, 282, 285, 288, 290], "further": [1, 6, 288], "class": [1, 3, 4, 7, 8, 9, 26, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 282], "under": [1, 110], "These": [1, 179, 294], "word": 1, "bit": [1, 72, 138, 139, 209, 228, 248], "abstract": 1, "back": [1, 3, 291], "give": [1, 3, 4, 24], "ourselv": 1, "concret": [1, 226, 290, 294], "imag": [1, 217, 219, 220], "public": [1, 213], "explicit": [1, 285, 291], "alpha_": 1, "beta_": 1, "must": [1, 6, 63, 78, 97, 110, 140, 141, 145, 148, 149, 191, 291], "know": [1, 3], "popul": 1, "To": [1, 2, 3, 4, 6, 213, 288, 292], "avoid": 1, "unnecessari": [1, 3], "alloc": [1, 282], "respons": 1, "space": [1, 111, 270], "void": 1, "eval_cpu": 1, "std": 1, "overrid": 1, "eval_gpu": 1, "jacobian": [1, 107, 189, 292], "product": [1, 102, 107, 122, 134, 137, 182, 189, 246, 292], "primal": [1, 107, 189], "tangent": [1, 20, 21, 107, 180, 181], "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, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 97, 98, 101, 110, 111, 121, 123, 125, 126, 128, 132, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 151, 152, 153, 167, 168, 169, 172, 173, 176, 177, 178, 179, 182, 183, 184, 185, 186, 187, 188, 190, 192, 213, 215, 216, 217, 221, 223, 224, 225, 226, 246, 248, 249, 251, 255, 257, 262, 263, 266, 270, 272, 282], "argnum": [1, 98, 187, 288], "cotan": 1, "across": [1, 223], "pair": [1, 135, 235, 251], "repres": [1, 3, 272, 291], "axi": [1, 3, 4, 12, 14, 22, 23, 24, 25, 29, 30, 31, 32, 40, 41, 42, 43, 45, 53, 56, 59, 64, 80, 82, 85, 88, 89, 90, 91, 92, 93, 110, 121, 123, 125, 126, 128, 135, 136, 137, 141, 151, 167, 168, 169, 172, 173, 176, 177, 178, 179, 183, 188, 190, 262, 263, 266, 270, 272, 289], "correspond": [1, 12, 14, 57, 63, 72, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 121, 123, 126, 137, 176, 182, 190, 206, 288], "dimens": [1, 3, 12, 14, 22, 23, 44, 50, 57, 66, 80, 89, 90, 92, 93, 94, 102, 110, 121, 122, 123, 125, 126, 137, 138, 141, 147, 176, 179, 182, 183, 188, 215, 216, 217, 219, 220, 223, 224, 225, 246, 249, 251, 257, 288], "vmap": [1, 288, 290, 292], "print": [1, 2, 3, 4, 6, 205, 206, 207, 213, 285, 288, 289, 290, 291, 292], "ostream": 1, "os": [1, 6], "equival": [1, 27, 47, 58, 74, 96, 178, 222, 245, 247, 248], "check": [1, 6, 60, 235, 288, 289], "bool": [1, 12, 14, 22, 23, 29, 30, 31, 32, 40, 41, 42, 43, 45, 56, 57, 59, 60, 110, 121, 123, 125, 126, 137, 139, 140, 145, 148, 149, 176, 188, 204, 215, 216, 217, 223, 224, 225, 226, 228, 232, 233, 235, 240, 243, 246, 248, 251, 255, 257], "is_equival": 1, "privat": 1, "fall": 1, "eval": [1, 2, 3, 4, 164, 213, 282, 284, 288, 290, 292], "deriv": [1, 288, 290], "base": [1, 110, 114, 116, 199, 201, 251, 257, 282, 284, 285, 289], "abov": [1, 3, 6, 138, 185, 198, 213, 288, 289, 290, 294], "demonstr": [1, 291], "treat": [1, 60, 89, 90, 92, 93, 178], "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, 122, 123, 124, 125, 126, 127, 128, 129, 130, 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, 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, 195, 196, 197, 198, 199, 200, 201, 203, 204, 205, 206, 207, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 228, 229, 232, 233, 235, 240, 243, 244, 245, 246, 247, 248, 249, 251, 253, 255, 256, 257, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 278, 279, 282, 284, 288, 290], "produc": [1, 246], "through": [1, 174, 200, 257, 288, 291], "construct": [1, 4, 97, 132, 192], "its": [1, 6, 122, 136, 147, 164, 184, 194, 197, 198, 199, 207, 213, 248, 291, 294], "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, 77, 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, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 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, 201, 205, 213, 251, 257, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 289], "shape": [1, 3, 4, 47, 60, 61, 65, 66, 82, 85, 88, 91, 92, 93, 97, 107, 122, 132, 133, 140, 141, 142, 144, 145, 148, 149, 152, 179, 189, 191, 192, 193, 213, 215, 216, 217, 219, 220, 224, 226, 235, 272, 284, 288, 289, 292, 294], "pass": [1, 3, 4, 47, 58, 134, 135, 187, 194, 205, 206, 213, 233, 243, 244, 245, 248, 253, 290], "re": [1, 4, 6], "now": [1, 3, 6, 248, 291], "promot": 1, "dtype": [1, 3, 15, 26, 33, 57, 81, 97, 101, 110, 111, 132, 142, 144, 145, 148, 149, 184, 192, 209, 261, 288, 289, 291, 292, 293], "promoted_dtyp": 1, "promote_typ": 1, "float32": [1, 15, 81, 101, 110, 111, 132, 142, 144, 148, 149, 184, 192, 209, 261, 288, 289, 290, 291, 292, 293], "non": [1, 6, 227, 241, 273, 282], "point": [1, 2, 3, 6, 96, 139, 209], "out_dtyp": 1, "is_floating_point": 1, "cast": [1, 33, 91, 92, 93, 112, 228, 291], "up": [1, 3, 248], "determin": [1, 293], "x_cast": 1, "astyp": [1, 3, 228, 291], "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, 81, 94, 98, 110, 135, 140, 149, 151, 153, 169, 173, 184, 185, 186, 187, 188, 190, 195, 197, 198, 199, 200, 203, 204, 205, 213, 215, 216, 217, 218, 219, 220, 222, 223, 224, 225, 247, 250, 251, 252, 255, 256, 257, 259, 260, 261, 263, 264, 265, 271, 272, 274, 275, 276, 278, 282, 285, 288, 289, 290, 291, 292, 293], "unique_ptr": 1, "make_uniqu": 1, "to_stream": 1, "handl": [1, 213], "resolv": 1, "No": [1, 3], "happen": [1, 3, 257, 284, 290], "alon": [1, 291], "effect": [1, 219, 290], "onli": [1, 3, 5, 6, 60, 65, 66, 110, 138, 209, 213, 232, 233, 235, 240, 243, 244, 245, 282, 288, 293, 294], "execut": [1, 6, 291, 294], "depend": [1, 2, 57, 110, 289, 293, 294], "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, 77, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 99, 100, 101, 102, 103, 104, 105, 106, 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, 144, 145, 147, 148, 149, 150, 151, 152, 153, 154, 160, 162, 163, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 188, 191, 192, 193, 294, 295], "specifi": [1, 15, 33, 66, 89, 90, 97, 98, 110, 111, 128, 132, 141, 151, 177, 178, 179, 182, 183, 187, 190, 192, 215, 256, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 278, 288, 294], "memori": [1, 5, 164, 282, 290, 291], "ha": [1, 3, 4, 5, 57, 88, 89, 91, 92, 93, 98, 141, 215, 226, 282, 284, 289, 290, 292, 294], "been": [1, 3, 290], "try": [1, 6], "naiv": [1, 288], "gener": [1, 2, 15, 81, 89, 90, 111, 140, 144, 145, 148, 149, 257, 285, 289, 290, 295], "version": [1, 6, 72, 117, 121, 138, 167, 190, 285, 288, 289], "declar": 1, "member": [1, 213, 238, 241], "method": [1, 3, 7, 8, 9, 26, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 213, 282], "each": [1, 50, 72, 78, 122, 135, 138, 139, 141, 151, 158, 159, 169, 183, 190, 191, 219, 220, 221, 223, 251, 257, 263, 285, 290], "find": [1, 2, 6], "pointwis": 1, "captur": [1, 213], "templat": 1, "axpby_impl": 1, "typenam": 1, "t": [1, 3, 76, 139, 187, 195, 196, 197, 198, 199, 200, 203, 204, 213, 288, 294], "readi": 1, "fill": [1, 97, 133, 184, 193], "malloc_or_wait": 1, "synchron": 1, "avail": [1, 2, 3, 4, 6, 8, 209, 294], "There": [1, 213], "wait": [1, 3], "here": [1, 3, 288, 290, 293, 294], "request": 1, "pressur": 1, "condit": [1, 191, 294], "set_data": 1, "nbyte": 1, "collect": [1, 202, 206, 287], "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, 80, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 97, 101, 110, 138, 139, 141, 152, 169, 172, 213, 216, 217, 221, 224, 248, 290, 291], "map": [1, 4, 112, 206, 221, 228], "linear": [1, 3, 4, 5, 206, 213, 222, 235, 248, 250, 252, 254, 258, 259, 260, 275, 276, 277, 282], "indic": [1, 13, 22, 23, 24, 25, 98, 103, 104, 105, 106, 169, 178, 179, 187, 240, 242, 263, 289], "offset": [1, 3], "x_offset": 1, "elem_to_loc": 1, "stride": [1, 65, 66, 216, 217, 251, 289], "y_offset": 1, "contigu": 1, "regularli": 1, "default": [1, 6, 12, 14, 15, 22, 23, 24, 25, 60, 64, 65, 66, 72, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 98, 101, 110, 111, 112, 121, 123, 125, 126, 132, 136, 137, 138, 139, 140, 141, 142, 144, 145, 147, 148, 149, 151, 152, 153, 168, 169, 172, 173, 176, 182, 183, 184, 185, 186, 187, 188, 190, 192, 195, 196, 197, 198, 199, 200, 202, 203, 204, 209, 215, 216, 217, 224, 226, 228, 233, 235, 240, 243, 246, 247, 248, 251, 255, 257, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 282, 285, 287, 288, 291, 293, 295], "row": [1, 81, 101, 138, 184], "major": 1, "henc": [1, 138], "doesn": [1, 213], "addit": [1, 3, 11, 215, 223, 225, 246, 249, 282, 288], "abl": [1, 138], "all": [1, 4, 6, 13, 24, 66, 78, 81, 84, 87, 90, 93, 122, 135, 136, 172, 201, 213, 228, 229, 233, 236, 237, 238, 241, 243, 246, 248, 255, 257, 282, 285, 289, 290, 292, 295], "incom": 1, "accordingli": 1, "dispatch": 1, "float16": [1, 112, 209, 228, 290, 291], "bfloat16": [1, 291], "complex64": 1, "throw": 1, "error": [1, 6, 76, 77, 169, 222, 248, 258, 259, 260, 268, 269, 288, 291], "encount": [1, 288], "unexpect": [1, 15], "regist": [1, 4], "op": [1, 134, 233, 290], "assert": 1, "2": [1, 2, 3, 4, 66, 76, 83, 86, 88, 89, 90, 91, 92, 93, 110, 116, 122, 138, 147, 182, 184, 185, 186, 195, 196, 197, 198, 203, 209, 213, 217, 222, 249, 255, 259, 265, 271, 272, 282, 288, 289, 290, 291, 292, 293, 294], "1": [1, 3, 4, 15, 24, 25, 65, 66, 82, 83, 85, 86, 88, 89, 90, 91, 92, 93, 94, 102, 110, 122, 134, 136, 138, 141, 149, 162, 168, 178, 187, 195, 196, 197, 198, 199, 200, 203, 204, 209, 213, 215, 216, 217, 218, 219, 220, 222, 223, 224, 225, 226, 247, 249, 251, 252, 255, 256, 259, 260, 261, 262, 263, 264, 265, 266, 268, 270, 271, 272, 276, 278, 282, 284, 288, 289, 291, 292, 293, 294], "correct": [1, 6, 197, 198, 199, 289, 290], "els": [1, 3, 213, 233, 290], "float16_t": 1, "bfloat16_t": 1, "complex64_t": 1, "runtime_error": 1, "support": [1, 3, 5, 6, 13, 65, 66, 112, 122, 138, 288, 289, 291, 293], "have": [1, 3, 6, 60, 89, 90, 92, 93, 122, 141, 200, 205, 246, 253, 287, 289, 290, 294], "rememb": 1, "3": [1, 3, 6, 110, 200, 285, 289, 291, 292], "complic": 1, "keep": [1, 12, 14, 22, 23, 121, 123, 125, 126, 137, 176, 188, 213, 232, 288, 290], "mind": [1, 3], "half": [1, 15, 145, 149, 251, 290], "precis": [1, 3, 213, 222], "direct": [1, 3, 200, 230, 294], "fix": [1, 3, 6, 290], "possibl": [1, 3, 122, 169, 221, 289, 294], "due": 1, "transpos": [1, 3, 27, 139], "aren": 1, "guarante": 1, "fit": [1, 138, 294], "requir": [1, 3, 213, 290, 291], "column": [1, 81, 101, 138], "inplac": 1, "expect": [1, 3, 216, 217, 218, 219, 220, 255, 257, 289], "answer": 1, "copi": [1, 3, 5, 136, 168, 291], "simpli": [1, 3, 6, 250, 275, 282, 288], "catlas_saxpbi": 1, "axpby_impl_acceler": 1, "first": [1, 2, 3, 4, 6, 94, 98, 118, 120, 122, 136, 147, 177, 182, 187, 197, 198, 199, 205, 213, 223, 262, 288, 291, 294], "mode": [1, 67, 231, 240, 242], "i": [1, 3, 107, 110, 198, 213, 216, 217, 219, 220, 233, 268, 288], "e": [1, 4, 6, 76, 107, 162, 196, 215, 216, 217, 219, 220, 223, 224, 225, 233, 249, 279, 284, 290, 295], "match": [1, 6, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 235, 289, 291], "transposit": 1, "data_s": 1, "items": 1, "flag": [1, 291], "copy_inplac": 1, "copytyp": 1, "n": [1, 3, 26, 65, 66, 81, 82, 84, 85, 87, 88, 91, 93, 101, 184, 188, 215, 216, 217, 219, 220, 268, 272], "incx": 1, "inci": 1, "great": 1, "But": [1, 294], "criteria": 1, "luckili": [1, 290], "alwai": [1, 205, 288], "With": 1, "final": [1, 2, 3, 4], "singl": [1, 4, 78, 107, 112, 135, 189, 289, 293], "row_contigu": 1, "col_contigu": 1, "common": [1, 290], "hit": 1, "mileston": 1, "enough": [1, 290], "run": [1, 3, 4, 5, 6, 134, 164, 195, 197, 198, 199, 215, 228, 290, 294, 295], "If": [1, 3, 6, 12, 14, 15, 22, 23, 24, 25, 57, 60, 63, 64, 67, 78, 91, 92, 93, 96, 97, 98, 110, 112, 121, 122, 123, 125, 126, 132, 135, 136, 137, 141, 151, 167, 168, 169, 176, 178, 179, 182, 187, 188, 190, 192, 206, 215, 216, 217, 223, 225, 226, 233, 235, 243, 248, 251, 253, 255, 272, 288, 290, 293, 294, 295], "plan": 1, "stop": [1, 3, 15, 111, 174, 288, 289], "enjoi": 1, "speed": 1, "appl": [1, 3, 5, 6, 294], "silicon": [1, 3, 5, 6, 294], "address": 1, "shade": 1, "languag": [1, 209], "kernel": [1, 65, 66, 289], "written": 1, "help": [1, 3, 294], "resourc": 1, "walkthrough": 1, "pipelin": 1, "specif": [1, 6, 288], "cpp": 1, "algorithm": [1, 200], "launch": [1, 289], "exactli": [1, 3, 235, 288], "mani": [1, 169, 216, 217, 221, 290], "thread": 1, "pick": 1, "updat": [1, 2, 3, 4, 198, 200, 204, 206, 215, 228, 235, 245, 284, 290], "assign": [1, 282], "axpby_gener": 1, "buffer": [1, 291], "constant": [1, 3, 6, 135, 203, 215, 223, 225, 249, 272, 291], "4": [1, 3, 72, 110, 138, 139, 158, 209, 215, 224, 248, 257, 289, 292, 294], "5": [1, 2, 3, 6, 110, 140, 203, 215, 218, 219, 220, 224, 271, 288, 289], "x_stride": 1, "6": [1, 3, 110, 158, 203, 257, 259, 260, 272, 289, 292], "y_stride": 1, "7": [1, 3, 110, 138, 289], "ndim": [1, 110], "8": [1, 3, 6, 110, 138, 195, 196, 197, 198, 199, 203, 209, 224, 257, 262, 289, 292, 294], "uint": 1, "index": [1, 5, 7, 9, 24, 80, 81, 98, 136, 178, 179, 187], "thread_position_in_grid": 1, "convert": [1, 57, 248, 290, 291, 292], "instanti": [1, 4, 290], "uniqu": [1, 285], "host": 1, "name": [1, 112, 138, 139, 156, 157, 158, 159, 202, 213, 223, 232, 235, 237, 289, 293], "identifi": [1, 205, 287], "instantiate_axpbi": 1, "type_nam": 1, "host_nam": 1, "axpby_general_": 1, "compil": [1, 6, 290], "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, 110, 156, 157, 213, 215, 219, 222, 231, 247, 248, 251, 252, 255, 258, 259, 260, 276, 288, 289, 292, 294], "later": [1, 6], "co": [1, 255, 288], "locat": [1, 244, 245, 294], "share": [1, 5, 72, 138, 139], "register_librari": 1, "potenti": 1, "path": [1, 6, 158, 159, 235], "tri": 1, "load": [1, 4, 5, 235], "hasn": 1, "alreadi": [1, 3], "static": [1, 6], "object": [1, 8, 26, 37, 57, 140, 145, 148, 149, 190, 205, 206, 219, 287], "why": [1, 3], "packag": [1, 2, 4], "process": [1, 3, 67, 206, 220, 221, 257, 287], "logic": [1, 118, 119, 120], "grid": 1, "shown": 1, "below": [1, 6, 110, 184, 186, 209, 290], "prepar": [1, 3], "carri": 1, "should": [1, 2, 3, 4, 6, 107, 138, 164, 179, 187, 189, 205, 213, 216, 217, 219, 220, 240, 246, 253, 264, 282, 287, 288, 290, 291, 295], "d": [1, 3, 102, 110, 122, 134, 178, 184, 185, 186, 195, 197, 199, 207, 220, 294], "ostringstream": 1, "kname": 1, "axpby_": 1, "general_": 1, "type_to_nam": 1, "make": [1, 3, 4, 6, 122, 213, 290, 292, 294], "sure": [1, 3, 6, 213], "look": [1, 3], "folder": 1, "get_colocated_mtllib_path": 1, "get_kernel": 1, "str": [1, 67, 98, 110, 112, 155, 156, 157, 158, 159, 187, 205, 207, 228, 229, 232, 233, 235, 237, 239, 243, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272], "encod": [1, 251, 255, 257], "compute_encod": 1, "get_command_encod": 1, "setcomputepipelinest": 1, "those": [1, 3, 213], "nelem": 1, "set_array_buff": 1, "setbyt": 1, "sizeof": 1, "threadgroup": 1, "higher": [1, 102, 288], "than": [1, 3, 57, 67, 74, 99, 100, 108, 109, 122, 200, 206, 251, 256, 271, 278, 288, 294], "max": [1, 110, 124, 199, 247, 262, 264, 272, 274, 288, 294], "allow": [1, 201, 213, 245, 282, 289, 292], "tgp_size": 1, "min": [1, 110, 127, 247, 274], "maxtotalthreadsperthreadgroup": 1, "3d": [1, 215, 220], "mtl": 1, "group_dim": 1, "grid_dim": 1, "divid": [1, 96, 138], "among": 1, "dispatchthread": 1, "few": [1, 3, 4, 5, 164, 290, 292], "thing": [1, 3], "note": [1, 3, 6, 13, 65, 66, 89, 90, 110, 138, 141, 213, 291, 293], "befor": [1, 3, 6, 24, 136, 232, 257, 289, 290], "move": [1, 128, 294], "track": [1, 213, 215], "activ": [1, 6, 219, 227, 256, 257, 273, 278, 279], "command": [1, 6], "instead": [1, 6, 213, 245, 255, 288, 290], "end_encod": 1, "end": [1, 138, 252, 256, 265, 271, 276, 278], "until": [1, 290, 292], "limit": [1, 63, 289], "flush": 1, "enqueu": 1, "commit": 1, "associ": [1, 158, 159, 290], "suggest": 1, "deeper": 1, "dive": 1, "studi": 1, "come": [1, 3, 288], "far": [1, 284], "built": [1, 6, 290], "includ": [1, 229, 248, 288, 289, 292, 293, 295], "forward": [1, 187, 290], "diff": 1, "push": 1, "along": [1, 22, 23, 64, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 110, 151, 167, 169, 173, 178, 179, 182, 213], "similarli": [1, 6, 122, 288, 290], "scale_arr": 1, "contribut": 1, "tangent_x": 1, "tangent_i": 1, "revers": [1, 183, 255], "arg": [1, 3, 8, 47, 58, 78, 158, 159, 164], "push_back": 1, "fulli": [1, 5, 291, 294], "overal": 1, "directori": [1, 3, 6], "extens": [1, 112, 209, 293], "h": [1, 65, 66, 110, 215, 217, 219, 220, 288, 290], "mlx_sample_extens": 1, "__init__": [1, 3, 4, 7, 8, 9, 26, 213, 282], "py": [1, 3, 6], "cmakelist": 1, "txt": 1, "setup": [1, 2, 4, 6], "hold": [1, 3, 8, 110, 201], "instal": 1, "pybind11": [1, 6], "sinc": [1, 3, 4, 200, 282, 291, 294], "compon": [1, 3], "etc": [1, 138, 213], "becom": 1, "pybind11_modul": 1, "m": [1, 6, 81, 110, 184, 195], "doc": [1, 4], "sampl": [1, 2, 3, 111, 140, 141, 142, 145, 148, 149, 272, 285], "_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, 101, 102, 103, 104, 105, 106, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 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, 205, 206, 222, 228, 232, 233, 243, 246, 255, 257, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 289], "r": [1, 3, 187, 219], "pbdoc": 1, "most": [1, 141, 213, 288, 289, 290], "complex": [1, 89, 90, 91, 92, 93, 140, 145, 148, 149, 205, 213, 245, 288], "bell": 1, "whistl": 1, "liter": 1, "string": [1, 291, 293], "modul": [1, 3, 4, 194, 248, 253, 257, 287, 290], "ensur": [1, 6, 268], "caster": 1, "find_packag": 1, "config": 1, "add_librari": 1, "sourc": [1, 128, 183], "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, 187, 261, 263, 264, 265, 266, 267, 268, 269, 270, 271], "destin": [1, 128], "automat": [1, 5, 112, 292, 293, 294], "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, 164], "describ": [1, 290], "util": [1, 3, 5, 6, 158, 213], "__name__": [1, 3], "__main__": [1, 3], "descript": [1, 3, 209], "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, 110, 121, 123, 125, 126, 137, 176, 188, 191, 204, 205, 206, 209, 223, 224, 226, 233, 235, 243, 246, 248, 251, 255, 257, 291], "python_requir": 1, "even": [1, 3, 290, 291], "though": [1, 3, 290, 291], "j8": 1, "libmlx_ext": 1, "cpython": 1, "3x": 1, "darwin": 1, "pip": [1, 6], "after": [1, 3, 4, 24, 96, 136, 138, 215, 223, 225, 246, 257, 271, 294], "plai": [1, 3], "ones": [1, 3, 133, 158, 164, 184, 244, 245, 248, 289], "b": [1, 3, 11, 13, 60, 73, 74, 75, 96, 99, 100, 102, 108, 109, 110, 117, 118, 120, 122, 124, 127, 129, 134, 138, 175, 182, 187, 226, 288, 289, 290, 291, 292, 293, 294], "f": [1, 2, 4, 110, 198, 213, 291], "item": [1, 2, 3, 4, 206, 290, 291, 292], "true": [1, 2, 3, 60, 110, 139, 167, 191, 205, 206, 209, 213, 215, 216, 217, 223, 224, 225, 226, 232, 233, 235, 240, 243, 248, 251, 255, 257, 268], "quick": [1, 5], "benchmark": 1, "compar": [1, 60], "time": [1, 3, 6, 164, 213, 288, 290, 294], "set_default_devic": 1, "256": [1, 4], "512": [1, 3, 257, 294], "random": [1, 2, 3, 4, 5, 215, 224, 235, 240, 288, 294, 295], "normal": [1, 2, 3, 148, 202, 215, 223, 224, 225, 249, 257, 291, 294], "bench": 1, "warm": 1, "rang": [1, 2, 3, 4, 6, 15, 111, 259, 260, 284, 285, 288, 290, 294], "100": [1, 2, 3, 288, 290, 294], "5000": 1, "simple_tim": 1, "custom_tim": 1, "3f": [1, 4], "custom": [1, 257], "114": 1, "109": 1, "modest": 1, "improv": [1, 3, 195, 196, 197, 198, 199, 203], "awai": [1, 3], "good": [1, 6, 294], "nn": [1, 3, 4, 158, 206, 213, 282, 284, 290], "grad": [1, 2, 4, 187, 284, 288, 289, 290, 292], "simplifi": [1, 290], "full": [1, 4, 47, 58, 67, 167, 244, 245, 290], "implement": [2, 4, 110, 195, 196, 197, 198, 199, 200, 201, 202, 203, 221, 232, 246, 251, 253, 255, 256, 257, 278, 288, 291], "basic": [2, 153, 288], "model": [2, 4, 5, 158, 194, 206, 213, 228, 231, 233, 235, 239, 240, 242, 243, 244, 246, 257, 282, 284, 290], "problem": [2, 4, 213], "metadata": 2, "num_featur": [2, 215], "num_exampl": 2, "1_000": 2, "num_it": 2, "10_000": 2, "iter": [2, 4, 206, 285, 290], "sgd": [2, 4, 200, 284], "lr": [2, 200], "01": [2, 198], "rate": [2, 195, 196, 197, 198, 199, 200, 203, 204], "ll": [2, 4, 265, 288], "synthet": 2, "dataset": [2, 290], "matrix": [2, 72, 81, 101, 110, 122, 138, 139, 248], "ground": [2, 3, 271], "truth": [2, 271], "w_star": 2, "valu": [2, 3, 10, 15, 22, 23, 37, 57, 60, 63, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 97, 110, 111, 135, 140, 141, 142, 144, 145, 148, 149, 178, 179, 187, 190, 194, 198, 202, 205, 206, 209, 218, 219, 220, 224, 226, 232, 246, 247, 251, 256, 257, 261, 262, 263, 264, 265, 267, 268, 269, 270, 271, 278, 282, 288], "gaussian": [2, 222, 258, 259, 260], "nois": 2, "exampl": [2, 3, 4, 15, 110, 178, 213, 215, 224, 233, 235, 240, 243, 261, 284, 285, 288, 289, 290, 291, 292, 293], "noisi": 2, "label": [2, 263], "ep": [2, 195, 196, 197, 198, 199, 203, 215, 223, 224, 225, 249, 262, 272], "1e": [2, 4, 13, 195, 196, 197, 198, 199, 203, 215, 223, 224, 225, 249, 262, 272], "us": [2, 3, 4, 5, 6, 15, 72, 74, 94, 110, 122, 138, 139, 151, 152, 195, 197, 198, 199, 200, 201, 205, 213, 219, 221, 222, 226, 228, 232, 244, 245, 246, 248, 251, 255, 257, 259, 260, 262, 282, 284, 285, 287, 288, 289, 292, 294], "weight": [2, 65, 66, 198, 200, 204, 206, 213, 235, 239, 248, 263, 282, 288, 290], "squar": [2, 3, 101, 154, 170, 187, 195, 197, 198, 199, 206, 213, 249, 269, 271, 288, 291], "loss": [2, 4, 187, 213, 284, 288, 290], "loss_fn": [2, 4, 284, 288], "w": [2, 66, 72, 138, 139, 187, 204, 215, 217, 219, 220, 226, 288], "mean": [2, 3, 4, 187, 213, 215, 223, 233, 249, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 288, 291], "grad_fn": [2, 288], "initi": [2, 3, 213, 215, 223, 224, 225, 226, 247, 249, 282, 290], "randomli": [2, 3, 218, 219, 220], "Then": [2, 6], "repeatedli": 2, "_": [2, 3, 213, 285, 290, 294], "verifi": [2, 6], "close": [2, 5, 6, 13], "error_norm": 2, "5f": 2, "someth": [2, 3, 289], "00005": 2, "00364": 2, "complet": [2, 3, 6, 244, 245, 288, 294], "logist": [2, 162, 254, 259, 260, 277], "github": [2, 4, 6], "repo": [2, 4, 6], "enabl": [3, 6, 204], "larg": [3, 213, 246, 268, 290], "ish": 3, "transform": [3, 5, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 194, 213, 215, 223, 225, 226, 232, 233, 243, 248, 251, 289], "compromis": 3, "eas": 3, "llama": 3, "famili": 3, "less": [3, 24, 109, 136, 251, 271], "200": 3, "line": [3, 290, 291], "python": [3, 37, 50, 57, 78, 205, 206, 207, 282, 287, 288, 291], "neural": [3, 5, 203, 221, 227, 273, 282], "network": [3, 5, 203, 215, 219, 221, 282], "build": [3, 5, 282], "concis": 3, "architectur": [3, 6, 213, 245, 294], "notabl": [3, 5], "rope": [3, 213], "posit": [3, 24, 98, 106, 128, 136, 187, 206, 213, 216, 217, 246, 251, 255, 272], "option": [3, 12, 14, 15, 22, 23, 24, 25, 26, 31, 32, 64, 65, 66, 67, 72, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 97, 98, 101, 105, 106, 110, 111, 112, 121, 123, 125, 126, 132, 135, 136, 137, 138, 139, 140, 141, 142, 144, 145, 147, 148, 149, 151, 152, 167, 168, 169, 172, 173, 176, 178, 179, 182, 183, 184, 185, 186, 187, 188, 190, 192, 195, 196, 197, 198, 199, 200, 203, 204, 205, 206, 215, 216, 217, 226, 228, 232, 233, 235, 243, 246, 248, 251, 255, 257, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 285, 293, 295], "kei": [3, 140, 141, 142, 144, 145, 147, 148, 149, 202, 205, 206, 232, 233, 243, 246, 251, 285, 287, 288], "cach": [3, 251], "concaten": 3, "project": [3, 246], "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, 213, 227, 273, 282], "dim": [3, 182, 221, 223, 224, 225, 246, 249, 251, 255, 257], "num_head": [3, 246, 257], "super": [3, 4, 213, 282], "tradit": [3, 219, 220, 251], "query_proj": 3, "bia": [3, 72, 138, 139, 197, 198, 199, 206, 213, 216, 217, 226, 233, 235, 243, 246, 248, 288], "key_proj": 3, "value_proj": 3, "out_proj": [3, 282], "__call__": [3, 4, 213, 282], "queri": [3, 246], "mask": [3, 240, 246, 289], "extract": [3, 213, 232, 282], "l": [3, 4, 213, 215, 216, 271], "reshap": [3, 110, 289], "combin": 3, "key_cach": 3, "value_cach": 3, "sqrt": [3, 76, 195, 196, 197, 198, 203, 215, 223, 224, 225, 226, 249, 255], "score": 3, "softmax": [3, 263], "values_hat": 3, "rm": [3, 6], "swiglu": 3, "rmsnorm": [3, 213], "llamaencoderlay": 3, "mlp_dim": [3, 257], "norm1": 3, "norm2": 3, "linear1": 3, "linear2": 3, "linear3": 3, "sigmoid": [3, 254, 259, 260, 261, 277], "instanc": [3, 138, 207, 213, 224, 228, 229, 230, 233, 236, 237, 243, 245, 253, 282, 291], "embed": [3, 213, 251, 255, 262], "emb": [3, 221, 255], "token": [3, 221], "num_lay": [3, 4, 284], "vocab_s": 3, "norm": [3, 199, 200, 223, 272], "multiheadattent": [3, 213], "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, 78, 80, 83, 84, 86, 87, 89, 90, 92, 93, 97, 98, 107, 110, 121, 123, 125, 126, 132, 135, 137, 140, 141, 142, 144, 145, 148, 149, 152, 167, 169, 172, 173, 176, 182, 183, 187, 188, 189, 192, 197, 198, 199, 200, 205, 207, 213, 233, 235, 236, 237, 238, 241, 243, 244, 245, 282, 287, 288, 290], "still": [3, 6, 110, 290], "consid": [3, 13, 60, 205, 206, 223, 287], "train": [3, 4, 213, 215, 218, 219, 220, 231, 233, 243], "ignor": [3, 63], "whatsoev": 3, "rest": [3, 206, 251], "subsect": 3, "prompt": 3, "autoregress": 3, "yield": [3, 4, 285], "temp": 3, "causal": 3, "save": [3, 5, 112, 138, 156, 157, 158, 159, 239, 290], "append": [3, 122, 290], "store": 3, "per": [3, 4, 72, 138, 139, 201, 215, 223, 224, 225, 249, 290], "care": [3, 290], "last": [3, 25, 57, 84, 87, 89, 90, 92, 93, 94, 102, 122, 141, 168, 182, 216, 217, 219, 220, 223, 291], "logit": [3, 141, 261, 263], "next": [3, 4], "categor": 3, "lazili": [3, 213], "noth": [3, 213, 290], "yet": [3, 110, 213, 282, 288, 289, 290, 292], "forc": [3, 4, 213, 292], "choos": [3, 251], "pars": 3, "feed": 3, "loop": [3, 4, 288, 290], "unsqueez": 3, "sequenc": [3, 215, 216, 257, 285, 294], "length": [3, 172, 215, 216], "len": [3, 84, 87, 90, 93], "overwrit": 3, "discard": [3, 205], "old": 3, "moment": [3, 197, 198, 199], "anymor": 3, "everyth": 3, "small": [3, 164, 215, 223, 225, 249, 268, 272, 294], "10": [3, 4, 114, 153, 158, 164, 206, 213, 235, 289], "12": 3, "8192": 3, "1024": 3, "actual": [3, 15, 235, 282, 290], "materi": [3, 5], "could": [3, 213], "20_000": 3, "machin": [3, 5, 6, 203], "8gb": 3, "ram": 3, "32": [3, 4, 138, 139, 209], "44": 3, "doubl": 3, "bracket": 3, "becaus": [3, 213, 290], "batch": [3, 122, 215, 216, 217, 219, 220, 246, 290], "zip": [3, 4], "haven": 3, "anyth": [3, 187, 290], "result": [3, 15, 57, 72, 102, 110, 112, 122, 134, 139, 151, 153, 173, 182, 191, 206, 255, 288, 291], "similar": [3, 206, 244, 245, 246, 262, 291, 293], "runtim": 3, "section": [3, 6, 169, 272, 288], "access": [3, 37, 213, 282, 290, 294], "origin": [3, 195, 196, 197, 199, 200, 215, 291], "sentencepiec": 3, "pytorch": [3, 5, 223, 288], "compat": [3, 141, 293], "npz": [3, 112, 158, 159, 235, 239, 293], "file": [3, 6, 112, 155, 156, 157, 158, 159, 235, 239, 288, 293], "directli": 3, "argpars": 3, "itertool": [3, 206], "starmap": [3, 206], "np": [3, 4, 291, 292], "torch": [3, 291], "map_torch_to_mlx": 3, "tok_embed": 3, "elif": 3, "replac": [3, 244, 245, 257, 271], "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, 223], "submodul": [3, 4, 213, 233, 234, 243, 245], "feed_forward": 3, "parser": 3, "argumentpars": 3, "add_argu": 3, "torch_weight": 3, "output_fil": 3, "parse_arg": 3, "state": [3, 4, 201, 202, 213, 284, 285], "savez": [3, 293], "k": [3, 81, 184, 185, 186, 226, 233], "v": [3, 67, 213, 233, 291], "left": [3, 110, 138, 222, 251, 259, 260, 265, 272], "disk": 3, "text": [3, 200, 227, 252, 256, 264, 265, 268, 271, 272, 273, 274, 276, 278], "format": [3, 112, 155, 156, 157, 158, 159, 291], "oper": [3, 5, 33, 164, 167, 174, 179, 200, 213, 257, 288, 289, 290, 291, 292, 294, 295], "dictionari": [3, 156, 157, 201, 202, 205, 213, 232, 244, 245, 287, 293], "represent": [3, 138, 205, 207], "tree_unflatten": 3, "helper": 3, "weight_fil": 3, "incur": 3, "sever": [3, 65, 66, 158, 159, 293], "futur": [3, 248, 289, 290], "pth": 3, "current": [3, 5, 6, 65, 66, 138, 213, 290], "around": 3, "m1": [3, 288, 294], "ultra": 3, "7b": 3, "me": 3, "ishmael": 3, "year": 3, "ago": 3, "never": [3, 290], "long": 3, "info": [3, 6], "247": 3, "press": [3, 110], "enter": 3, "littl": 3, "monei": 3, "my": [3, 6], "purs": 3, "greater": [3, 24, 100, 136, 256, 278], "consequ": 3, "walk": 3, "down": 3, "gower": 3, "street": 3, "afternoon": 3, "heavi": 3, "rain": 3, "saw": [3, 288], "off": [3, 6, 290], "man": 3, "rag": 3, "who": 3, "sat": 3, "upon": [3, 206], "hi": 3, "bundl": 3, "hard": 3, "wet": 3, "he": 3, "were": [3, 294], "cry": 3, "watch": 3, "him": 3, "observ": 3, "numer": [3, 110, 117, 121, 167, 195, 196, 197, 198, 199, 203, 215, 223, 224, 225, 249, 262, 272, 290], "crowd": 3, "wa": [3, 202, 290], "hurri": 3, "437": 3, "330": 3, "second": [3, 118, 120, 122, 177, 187, 197, 198, 199, 262, 288, 294], "spent": 3, "amount": 3, "39": 3, "ms": 3, "By": [3, 288, 291], "bigger": 3, "remain": [3, 187, 218, 219, 220], "almost": 3, "nobodi": 3, "took": 3, "least": [3, 63, 138], "notic": [3, 288, 293], "distanc": [3, 272], "had": 3, "doubt": 3, "minut": 3, "straight": 3, "slowli": 3, "rais": [3, 110, 169, 235], "ey": 3, "speak": [3, 110], "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, 228], "repli": 3, "again": [3, 6, 213], "hand": [3, 288, 290], "did": 3, "accustom": 3, "thu": [3, 213], "question": [3, 290], "reason": [3, 289], "tell": [3, 291], "understand": 3, "579": 3, "690": 3, "num": [3, 111, 147], "500": [3, 294], "628": 3, "went": 3, "nervou": 3, "trembl": 3, "told": 3, "And": 3, "perhap": 3, "surpris": 3, "matter": [3, 213], "shall": 3, "anyhow": 3, "friend": 3, "ye": 3, "slight": [3, 290], "kind": 3, "longer": [3, 67, 288], "soon": 3, "unless": [3, 110, 282], "unlik": [3, 13, 219, 220], "strang": 3, "amus": 3, "That": 3, "secret": 3, "disappoint": 3, "mine": 3, "cannot": [3, 63, 289, 291], "happi": 3, "ask": 3, "Is": [3, 255, 257], "shop": 3, "bui": 3, "food": 3, "633": 3, "21": 3, "475": 3, "su": 3, "j": [3, 6, 110, 196, 197, 199, 219], "lu": 3, "pan": 3, "murtadha": 3, "wen": 3, "liu": 3, "2021": 3, "roform": [3, 251], "enhanc": [3, 251, 290], "rotari": [3, 251], "arxiv": [3, 195, 200, 223, 224, 225, 227, 249, 273], "preprint": [3, 195, 200], "2104": 3, "09864": 3, "zhang": 3, "sennrich": 3, "2019": [3, 198], "root": [3, 154, 170, 249], "advanc": 3, "inform": [3, 4, 6, 156, 157, 213, 215, 222, 246, 288, 294], "system": [3, 6], "shazeer": 3, "2020": 3, "glu": 3, "variant": [3, 199, 271], "2002": 3, "05202": 3, "classifi": 4, "mnist": 4, "As": [4, 178, 213], "mlp": [4, 213, 257, 284], "inherit": [4, 287], "standard": [4, 37, 57, 122, 142, 257, 292], "idiom": 4, "input_dim": [4, 213, 226, 248], "hidden_dim": [4, 282, 284], "output_dim": [4, 213, 226, 248], "layer_s": 4, "idim": 4, "odim": 4, "maximum": [4, 22, 63, 213, 250, 255, 259, 260, 275, 282, 290], "cross": [4, 261, 263], "entropi": [4, 261, 263], "sub": [4, 147], "commonli": [4, 244], "cross_entropi": [4, 213], "accuraci": 4, "valid": [4, 67, 190, 205, 233, 243, 287], "eval_fn": 4, "argmax": 4, "loader": 4, "num_class": [4, 284], "batch_siz": [4, 284], "num_epoch": [4, 284], "learning_r": [4, 195, 196, 197, 198, 199, 200, 203, 204, 284], "train_imag": [4, 284], "train_label": [4, 284], "test_imag": 4, "test_label": 4, "shuffl": 4, "minibatch": 4, "batch_iter": [4, 284], "perm": 4, "permut": 4, "id": [4, 6], "put": 4, "trainabl": [4, 194, 213, 282], "loss_and_grad_fn": [4, 284, 288], "value_and_grad": [4, 213, 244, 282, 284, 288, 291, 292], "epoch": 4, "test": [4, 6], "confus": 4, "decent": 4, "95": 4, "brought": 5, "research": 5, "except": [5, 81, 88, 89, 91, 92, 93, 223, 235, 289, 291], "featur": [5, 65, 66, 215, 223, 224, 225, 226, 248, 249, 251, 257, 290], "main": [5, 81, 206, 213], "differ": [5, 175, 271, 288], "lazi": [5, 282, 292], "multi": [5, 216, 217, 289, 291], "cpu": [5, 294], "gpu": [5, 289, 294], "inspir": 5, "jax": [5, 285], "arrayfir": 5, "unifi": 5, "live": [5, 294], "guid": 5, "convers": 5, "regress": [5, 268], "layer": [5, 213, 219, 220, 223, 225, 226, 240, 245, 248, 253, 257, 279, 282], "perceptron": 5, "llm": 5, "infer": [5, 97, 112], "fft": 5, "algebra": 5, "tree": [5, 78, 98, 164, 187, 190, 201, 205, 206, 207, 288], "develop": [5, 6], "document": [5, 47, 58, 156, 157, 288, 289], "meet": 6, "seri": 6, "chip": 6, "nativ": 6, "maco": 6, "13": 6, "recommend": [6, 200], "14": 6, "sonoma": 6, "distribut": [6, 140, 141, 142, 144, 148, 149, 226, 266, 270, 272], "probabl": [6, 145, 218, 219, 220, 248, 266, 294], "platform": 6, "processor": 6, "arm": [6, 209], "i386": 6, "switch": 6, "conda": 6, "17": 6, "g": [6, 110, 138, 203, 204, 279, 290, 295], "clang": 6, "cmake": 6, "24": 6, "xcode": 6, "15": [6, 110], "environ": 6, "via": [6, 290, 291], "rosetta": 6, "unam": 6, "p": [6, 140, 197, 199, 213, 218, 219, 220, 272], "clone": 6, "git": 6, "com": 6, "ml": 6, "explor": 6, "cd": 6, "brew": 6, "global": [6, 146, 285], "env": 6, "cmake_build_parallel_level": 6, "edit": [6, 245], "unittest": 6, "discov": 6, "stub": 6, "dev": 6, "generate_stub": 6, "mkdir": 6, "either": [6, 11, 47, 57, 58, 63, 73, 74, 75, 96, 99, 100, 108, 109, 110, 117, 122, 124, 127, 129, 175, 187, 253], "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, 122, 129, 138, 139, 246, 255, 290, 293], "wish": 6, "variabl": [6, 98, 107, 187, 189, 190], "export": 6, "developer_dir": 6, "app": 6, "content": [6, 232], "sdk": 6, "xcrun": 6, "macosx": 6, "show": [6, 209], "unabl": 6, "tool": 6, "select": [6, 191, 228, 232], "sudo": 6, "ouptut": 6, "finder": 6, "iterm": 6, "termin": 6, "click": 6, "uncheck": 6, "window": 6, "restart": 6, "devicetyp": 7, "attribut": [7, 8, 9, 26, 282], "kwarg": [8, 158, 159, 295], "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, 77, 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, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 144, 145, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 191, 192, 193, 217, 233, 235, 243], "absolut": [10, 13, 259, 260, 271], "semant": [11, 61, 73, 74, 75, 99, 100, 108, 109, 117, 122, 124, 127, 129, 175, 294], "keepdim": [12, 14, 22, 23, 29, 30, 31, 32, 40, 41, 42, 43, 45, 56, 59, 110, 121, 123, 125, 126, 137, 167, 176, 188], "reduct": [12, 14, 121, 123, 126, 137, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272], "reduc": [12, 14, 22, 23, 121, 123, 125, 126, 137, 164, 176, 188, 215, 268], "unspecifi": [12, 14, 15, 22, 23, 24, 25, 64, 97, 121, 123, 125, 126, 132, 136, 137, 151, 167, 168, 176, 178, 188, 192, 295], "entir": [12, 14, 22, 23, 121, 123, 125, 126, 137, 176, 188, 219, 220], "singleton": [12, 14, 22, 23, 121, 122, 123, 125, 126, 137, 176, 188], "rtol": 13, "05": [13, 215, 223, 224, 225, 249], "atol": 13, "08": [13, 196, 197, 198, 199, 203, 262], "approxim": [13, 164, 222, 258, 259, 260], "comparison": [13, 75, 99, 100, 108, 109], "equal": [13, 24, 60, 81, 100, 109, 136, 145, 169, 224, 226], "ab": [13, 110, 187, 223, 224, 225, 227, 249, 273], "array_equ": 13, "rel": 13, "toler": 13, "boolean": [13, 60, 103, 104, 105, 106, 118, 119, 120, 209, 242, 289], "interv": [15, 111, 145, 149], "increment": 15, "otherwis": [15, 205, 206, 233, 235, 243, 256, 257, 265, 271, 278, 290, 291], "int32": [15, 110, 145, 209, 289, 292], "convent": [15, 67, 198], "lead": 15, "fraction": 15, "integr": [15, 178, 290], "invers": [16, 17, 18, 19, 20, 21, 77, 85, 86, 87, 88, 89, 90], "cosin": [16, 17, 68, 69, 251, 262, 288], "hyperbol": [17, 19, 21, 69, 166, 181], "sine": [18, 19, 165, 166, 251, 288], "minimum": [23, 63, 255, 262], "kth": [24, 136], "partit": 24, "order": [24, 110, 136, 138, 213, 223, 244, 253, 288], "undefin": [24, 136, 289], "sort": [24, 25, 136], "flatten": [24, 25, 110, 134, 136, 151, 168, 178, 179, 205], "dimension": [26, 82, 83, 84, 85, 86, 87, 91, 92, 93, 215, 216, 217, 221, 226, 248, 255, 289, 291], "val": [26, 97], "tupl": [26, 47, 58, 64, 66, 74, 78, 80, 107, 110, 135, 138, 152, 172, 187, 189, 197, 198, 199, 200, 205, 206, 207, 217, 235, 237, 251, 253, 287, 288], "ndarrai": [26, 289, 290, 292], "properti": [27, 35, 44, 50, 52, 242, 288], "argument": [27, 47, 58, 78, 98, 187, 206, 213, 285, 288, 293, 294, 295], "decim": [48, 153], "indices_or_sect": [53, 169], "nest": [57, 213, 282, 287, 288], "ddof": [59, 188], "equal_nan": 60, "nan": [60, 104], "a_min": 63, "a_max": 63, "edg": [63, 135], "At": 63, "anoth": [63, 122, 175, 191, 213, 228, 288, 289, 294], "pad": [65, 66, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 216, 217], "dilat": [65, 66], "group": [65, 66, 72, 138, 139, 223, 248], "1d": [65, 67, 179], "convolut": [65, 66, 67, 216, 217, 219, 220], "channel": [65, 66, 215, 216, 217, 219, 220], "c_in": [65, 66], "c_out": [65, 66], "convolv": [65, 66], "2d": [66, 138, 215, 219], "spatial": [66, 223], "symmetr": 66, "discret": [67, 82, 83, 84, 85, 86, 87, 91, 92, 93, 221], "swap": [67, 177, 245, 248], "conv": 67, "filter": [67, 216, 217, 228, 232], "flip": 67, "signal": 67, "bias": [72, 138, 139, 233, 243, 246], "group_siz": [72, 138, 139, 248], "64": [72, 138, 139, 209, 248], "configur": 72, "formal": [72, 138], "notat": [72, 205, 237], "quantiz": [72, 112, 139, 248], "w_i": [72, 138], "hat": [72, 138], "occupi": [72, 138, 139], "divis": [73, 96, 138], "quotient": [73, 74, 96], "remaind": 74, "fuction": 74, "faster": [74, 258, 288], "mathrm": [76, 162, 224], "frac": [76, 138, 162, 195, 196, 197, 198, 199, 203, 215, 218, 219, 220, 223, 224, 225, 226, 249, 262, 265, 268], "pi": [76, 255, 288], "int_0": 76, "dx": 76, "erf": 77, "node": [78, 164, 190], "dict": [78, 112, 156, 157, 158, 238, 241, 244, 245, 282, 287, 288, 293], "leaf": [78, 205, 206, 232], "exponenti": [79, 252, 276], "insert": [80, 294], "ident": [81, 174, 240], "diagon": [81, 184, 185, 186], "zero": [81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 184, 185, 186, 193, 213, 218, 219, 220, 235, 289], "th": 81, "whose": [81, 194], "One": [82, 85, 91, 154, 288], "fourier": [82, 83, 84, 85, 86, 87, 91, 92, 93], "truncat": [82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 148], "dft": [82, 83, 84, 85, 86, 87, 91, 92, 93], "rfft": 88, "real": [88, 89, 90, 91, 92, 93], "rfft2": 89, "rfftn": 90, "silent": [91, 92, 93], "start_axi": 94, "end_axi": 94, "integ": [96, 110, 135, 138, 139, 140, 145, 169, 182, 190, 209, 221, 289], "floor": 96, "fun": [98, 107, 187, 189, 190, 289, 290, 294], "argnam": [98, 187], "cpp_function": [], "neither": [98, 187], "keyword": [98, 158, 159, 187, 206, 213, 285, 293, 295], "strict": [99, 108, 233, 235, 243], "ordinari": 102, "ord": 110, "tabl": [110, 209, 221], "frobeniu": 110, "matric": 110, "strictli": 110, "mathemat": 110, "variou": 110, "purpos": 110, "calcul": 110, "fro": 110, "inf": [110, 246], "largest": 110, "sing": 110, "smallest": 110, "singular": 110, "nuclear": 110, "_f": 110, "sum_": [110, 268], "a_": 110, "valueerror": [110, 235, 288], "refer": [110, 224, 227, 273, 289], "golub": 110, "van": 110, "loan": 110, "baltimor": 110, "md": 110, "john": 110, "hopkin": 110, "univers": 110, "1985": 110, "pg": 110, "la": 110, "arang": [110, 289, 291], "9": [110, 195, 197, 198, 199, 200, 291], "74597": 110, "20": 110, "84804": 110, "41421": 110, "23607": 110, "74166": 110, "24264": 110, "11": 110, "225": 110, "50": 111, "evenli": 111, "binari": [112, 155, 156, 157, 158, 159, 256, 261, 278], "npy": [112, 155, 293], "safetensor": [112, 157, 290, 293], "gguf": [112, 156, 293], "unsupport": 112, "tensor": [112, 182, 272, 291], "natur": [113, 115, 290], "logarithm": [113, 114, 115, 116], "log": [115, 117, 121, 266, 268, 270], "plu": 115, "exp": [117, 121, 142, 167, 252, 266, 276, 294], "stabl": [117, 121, 167, 268], "prepend": 122, "remov": [122, 141, 172], "negat": 130, "beforehand": 134, "pad_with": 135, "constant_valu": 135, "pad_width": 135, "before_1": 135, "after_1": 135, "before_2": 135, "after_2": 135, "before_n": 135, "after_n": 135, "before_i": 135, "after_i": 135, "extend": 135, "side": 135, "smaller": [136, 200], "everi": [138, 164, 206, 288], "particular": [138, 223], "consecut": [138, 251], "w_1": 138, "w_g": 138, "begin": [138, 252, 256, 265, 271, 276, 278], "align": 138, "max_i": 138, "min_i": 138, "textrm": [138, 222, 258], "round": 138, "pack": [138, 139], "unsign": [138, 139, 209], "lower": [138, 145, 148, 149, 184], "upper": [138, 145, 148, 149], "1st": 138, "signific": 138, "2nd": 138, "dequant": 138, "w_q": 138, "whether": [139, 232, 246], "prng": [140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 285], "num_sampl": 141, "unnorm": [141, 261, 263], "draw": 141, "uint32": [141, 209], "cdf": [142, 222, 258], "accord": [142, 191, 246], "seed": 143, "low": [145, 149], "high": [145, 149, 213, 221], "bound": [145, 148, 149, 222, 289, 294], "roadcast": 145, "domain": 148, "uniformli": 149, "repetit": 151, "preserv": [152, 288], "reciproc": 154, "arr": [155, 289], "uncompress": 158, "my_path": 158, "tree_flatten": [158, 206, 207, 213], "transformerencod": 158, "128": [158, 213], "flat_param": 158, "compress": 159, "simplif": 164, "reus": 164, "consumpt": 164, "meant": 164, "overhead": [164, 290, 294], "1m": 164, "thousand": [164, 290], "foo": 164, "matmul": [164, 294], "twice": [164, 294], "subarrai": 169, "being": [174, 213], "prevent": [174, 272, 291], "flow": [174, 290], "unchang": [174, 251], "axis1": 177, "axis2": 177, "taken": 178, "prior": [178, 179], "exclud": 179, "dot": [182, 205, 237, 246], "elsewher": [184, 289], "col": 184, "triangl": 184, "mse": 187, "param": [187, 213, 288], "lvalu": 187, "dlvalu": 187, "dparam": 187, "lasso": 187, "l1": [187, 265, 267, 268, 271], "varianc": [188, 215, 223], "divisor": 188, "cotang": 189, "in_ax": [190, 288], "out_ax": [190, 288], "prefix": [190, 205], "fn": [194, 206, 292], "callabl": [194, 205, 206, 228, 229, 232, 253, 257], "wrt": 194, "rho": 195, "06": [195, 272], "paper": [195, 196, 197, 199, 200, 215, 255], "zeiler": 195, "2012": [195, 203], "adapt": [195, 196], "1212": 195, "5701": 195, "v_": [195, 196, 197, 198, 199, 203, 204], "v_t": [195, 196, 197, 198, 199, 203, 204], "g_t": [195, 196, 197, 198, 199, 200, 203, 204], "delta": [195, 265], "w_": [195, 196, 197, 198, 199, 200, 203, 204], "u_t": 195, "epsilon": [195, 196, 197, 198, 199, 203, 215, 223, 224, 225, 249, 262], "u_": 195, "w_t": [195, 196, 197, 198, 199, 200, 203, 204], "lambda": [195, 196, 197, 198, 199, 200, 203, 204, 206, 213, 228, 233, 252, 276, 288], "averag": [195, 197, 198, 199], "denomin": [195, 196, 197, 198, 199, 203, 224, 262], "stabil": [195, 196, 197, 198, 199, 203, 215, 223, 224, 225, 249, 262], "duchi": 196, "hazan": 196, "singer": 196, "2011": 196, "subgradi": 196, "onlin": 196, "stochast": [196, 197, 199, 204, 290], "jmlr": 196, "999": [197, 198, 199], "omit": [197, 199], "estim": [197, 199], "kingma": [197, 199], "ba": [197, 199], "2015": [197, 199, 219], "iclr": [197, 198, 199], "m_": [197, 198, 199, 200], "beta_1": [197, 198, 199, 200], "m_t": [197, 198, 199, 200], "beta_2": [197, 198, 199, 200], "weight_decai": [198, 200, 204], "contrast": [198, 202], "loshchilov": 198, "hutter": 198, "decoupl": 198, "decai": [198, 200, 204], "regular": [198, 219, 227, 273, 289], "adam": [199, 200], "infin": [103, 105, 106, 199], "99": [200, 203], "sign": [200, 209], "tend": 200, "larger": [200, 251], "10x": 200, "adamw": 200, "maintain": [200, 219, 220], "strength": [200, 204], "wd": 200, "chen": 200, "symbol": 200, "discoveri": 200, "2302": 200, "06675": 200, "c_": 200, "eta": 200, "c_t": 200, "momentum": [200, 204, 215], "basi": 201, "appli": [201, 206, 213, 215, 216, 217, 219, 220, 222, 223, 224, 225, 226, 227, 229, 240, 247, 248, 249, 250, 252, 254, 256, 258, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278], "optimizerst": 201, "recurs": [202, 213, 232, 233, 238, 241, 243, 282], "defaultdict": 202, "miss": [202, 235, 293], "present": 202, "tieleman": 203, "hinton": 203, "lectur": 203, "coursera": 203, "smooth": [203, 263, 271], "dampen": 204, "nesterov": 204, "descent": [204, 290], "mu": 204, "tau": 204, "l2": [204, 265, 268], "penalti": 204, "is_leaf": [205, 206], "arbitrari": [205, 282], "depth": [205, 220, 288], "hello": [205, 207], "charact": 205, "flat": [205, 207], "superset": 206, "extra": 206, "closer": 206, "constitut": 206, "dict_kei": 206, "recreat": 207, "world": 207, "42": 207, "byte": 209, "bool_": 209, "uint8": 209, "uint16": 209, "16": [209, 224, 228, 282], "uint64": 209, "int8": 209, "int16": 209, "int64": 209, "arbitrarili": [213, 287, 288, 292], "done": [213, 218, 290, 291], "manual": 213, "explicitli": [213, 285], "solv": 213, "intuit": 213, "freez": [213, 243, 282], "finetun": 213, "in_dim": [213, 282], "out_dim": [213, 282], "enumer": 213, "caus": [213, 290], "local": [213, 219], "scope": 213, "l2_loss": 213, "y_hat": 213, "trainable_paramet": [213, 232], "loss_and_grad": 213, "workhors": 213, "Its": 213, "frozen": [213, 233, 241, 243, 248, 282], "individu": [213, 219, 220], "subset": [213, 232], "action": 213, "displai": 213, "tree_map": 213, "count": 213, "num_param": 213, "preclud": 213, "pure": [213, 284], "pattern": [213, 290], "achiev": 213, "other_input": 213, "necessari": 213, "wrap": 213, "apply_to_modul": [213, 233], "children": 213, "filter_and_map": 213, "leaf_modul": 213, "load_weight": [213, 290], "named_modul": 213, "save_weight": 213, "unfreez": [213, 233], "update_modul": 213, "sequenti": 213, "relu": [213, 247, 257, 274], "prelu": 213, "gelu": [213, 259, 260], "silu": 213, "selu": 213, "mish": 213, "quantizedlinear": 213, "conv1d": 213, "conv2d": 213, "batchnorm": 213, "layernorm": 213, "groupnorm": 213, "instancenorm": 213, "dropout": [213, 219, 220, 240, 257], "dropout2d": 213, "dropout3d": 213, "alibi": 213, "sinusoidalpositionalencod": 213, "gelu_approx": [213, 222, 258], "gelu_fast_approx": [213, 222, 258], "binary_cross_entropi": 213, "kl_div_loss": 213, "l1_loss": 213, "mse_loss": 213, "nll_loss": 213, "smooth_l1_loss": 213, "triplet_loss": 213, "hinge_loss": 213, "huber_loss": 213, "log_cosh_loss": 213, "cosine_similarity_loss": 213, "affin": [215, 223, 224, 225, 226, 248], "track_running_stat": 215, "var": [215, 223, 224, 225], "gamma": [215, 223, 224, 225, 249], "nc": 215, "nlc": [215, 216], "four": 215, "nhwc": [215, 217], "height": [215, 217, 219, 220], "width": [215, 217, 219, 220, 248], "deep": 215, "intern": 215, "covari": 215, "shift": 215, "bn": 215, "in_channel": [216, 217], "out_channel": [216, 217], "kernel_s": [216, 217], "learnabl": [216, 217, 253], "portion": 218, "dure": [218, 219, 220, 291], "independ": [219, 220], "nwhc": 219, "whc": 219, "entri": [219, 220], "benefici": [219, 220, 290], "earli": 219, "adjac": 219, "pixel": 219, "correl": 219, "thompson": 219, "goroshin": 219, "jain": 219, "lecun": 219, "bregler": 219, "cvpr": 219, "ndhwc": 220, "dhwc": 220, "medic": 220, "video": 220, "num_embed": 221, "lookup": 221, "typic": [221, 284, 290], "usual": [221, 287, 290], "vocabulari": 221, "approx": 222, "unit": [222, 250, 252, 254, 258, 259, 260, 275, 276, 277], "phi": [222, 258], "geluapprox": 222, "sigma": [222, 254, 259, 260, 277], "60033": [222, 259], "0433603": [222, 259], "gelufast": 222, "773": [222, 260], "regard": 222, "num_group": 223, "pytorch_compat": 223, "split": 223, "preced": 223, "http": [223, 224, 225, 227, 249, 273], "org": [223, 224, 225, 227, 249, 273], "1803": 223, "08494": 223, "inorm": 224, "1607": [224, 225], "08022": 224, "06450": 225, "uniform": [226, 235, 285, 288, 294], "mathcal": 226, "u": 226, "d_i": 226, "monoton": [227, 273], "1908": [227, 273], "08681": [227, 273], "tanh": [227, 273], "softplu": [227, 273], "map_fn": [228, 232], "filter_fn": [228, 232], "valid_parameter_filt": 228, "apply_fn": 229, "descend": 230, "is_leaf_fn": 232, "found": 232, "drop": 232, "idempot": [233, 243], "attent": [233, 246, 255, 257], "endswith": 233, "file_or_weight": 235, "ok": [235, 288], "certain": 240, "ie": 243, "noop": 243, "unfrozen": 243, "chang": [244, 248, 265, 271, 291], "tracer": 244, "partial": [244, 245, 290], "child": 245, "programmat": 245, "query_input_dim": 246, "key_input_dim": 246, "value_input_dim": 246, "value_dim": 246, "value_output_dim": 246, "head": [246, 257], "aggreg": 246, "linearli": 246, "neg": [105, 246, 270, 272, 289], "attend": 246, "num_paramet": 247, "init": 247, "25": 247, "parametr": [247, 274], "classmethod": 248, "from_linear": 248, "quantize_modul": 248, "1910": 249, "07467": 249, "rectifi": [250, 275], "10000": 251, "rotat": 251, "slightli": [251, 294], "angular": 251, "frequenc": [251, 255], "_cos_sin_theta_kei": 251, "precomput": 251, "_cos_sin_theta_valu": 251, "leq": [252, 265, 276], "0507": [252, 276], "67326": [252, 276], "elu": [252, 276], "plain": 253, "known": [254, 277], "swish": [254, 277], "cdot": [254, 259, 260, 262, 264, 277], "min_freq": 255, "0001": 255, "max_freq": 255, "cos_first": 255, "full_turn": 255, "sinusoid": 255, "sin": [255, 288, 292], "threshold": [256, 265, 271, 278], "geq": [256, 278], "num_encoder_lay": 257, "num_decoder_lay": 257, "custom_encod": 257, "custom_decod": 257, "norm_first": 257, "decod": 257, "interact": 257, "mechan": 257, "hidden": 257, "exact": [259, 260], "0003": 259, "015": 260, "pre": 261, "predict": [261, 263, 264, 265, 266, 267, 268, 269, 270, 271], "105361": 261, "223144": 261, "20397": 261, "916291": 261, "612192": 261, "x1": 262, "x2": 262, "x_1": 262, "x_2": 262, "label_smooth": 263, "hing": 264, "y_": [264, 268], "pred": [264, 268], "huber": 265, "l_": [265, 272], "kullback": 266, "leibler": 266, "diverg": 266, "cosh": 268, "logcosh": 268, "sensit": 268, "outlier": 268, "dual": 268, "behavior": [268, 289, 290], "offer": 268, "balanc": 268, "robust": 268, "approach": [268, 288], "task": 268, "likelihood": 270, "nll": 270, "formula": 271, "anchor": 272, "margin": 272, "triplet": 272, "_p": 272, "degre": 272, "pairwis": 272, "instabl": 272, "subclass": 282, "concept": 282, "mymlp": 282, "in_proj": 282, "subsequ": 284, "implicit": [285, 288], "fine": [285, 290], "grain": 285, "control": [285, 290], "manag": [285, 294], "pseudo": 285, "altern": 285, "splittabl": 285, "threefri": 285, "counter": 285, "cycl": 287, "slice": 289, "ellipsi": 289, "syntax": 289, "idx": 289, "mix": 289, "take_along_axi": 289, "lack": 289, "propag": [288, 289], "extrem": [289, 290], "ineffici": [289, 290], "nonzero": 289, "reflect": [289, 291], "dfdx": [288, 289], "record": 290, "nice": [288, 290], "rerun": 290, "dynam": 290, "easier": 290, "worri": 290, "fun1": 290, "expensive_fun": 290, "cost": 290, "code": 290, "consum": 290, "eager": 290, "thank": 290, "weights_fp16": 290, "trade": 290, "too": 290, "bad": 290, "idea": [288, 290], "On": [288, 290], "grow": 290, "computation": 290, "costli": 290, "wide": 290, "pretti": 290, "ten": [288, 290], "okai": 290, "outer": 290, "value_and_grad_fn": 290, "awar": 290, "implicitli": 290, "anytim": 290, "memoryview": [290, 291], "perfectli": 290, "first_lay": 290, "second_layer_a": 290, "second_layer_b": 290, "frequent": 290, "protocol": 291, "receiv": 291, "pep": 291, "3118": 291, "view": 291, "a_view": 291, "owndata": 291, "quit": [288, 291], "power": [288, 291], "extern": 291, "x_view": 291, "modifi": 291, "df": 291, "x\u00b2": 291, "2x": 291, "indirectli": 291, "modif": 291, "seen": 291, "occur": 291, "incorpor": 291, "issu": [288, 291], "incorrect": 291, "experiment": 291, "break": 291, "advis": 291, "intermedi": 291, "jnp": 291, "tf": 291, "inspect": 292, "page": 292, "composit": 292, "archiv": 293, "savez_compress": 293, "save_safetensor": 293, "save_gguf": 293, "arr_0": 293, "pool": 294, "advantag": 294, "don": 294, "parallel": 294, "race": 294, "interest": 294, "albeit": 294, "contriv": [288, 294], "suppos": [288, 294], "d1": 294, "d2": 294, "4096": [288, 294], "dens": 294, "better": [288, 294], "millisecond": 294, "measur": 294, "default_stream": 295, "default_devic": 295, "my_devic": 295, "pypi": 6, "forg": 6, "grep": 6, "cmake_host_system_processor": 6, "arm64": 6, "x86_64": 6, "wipe": 6, "cahc": 6, "rf": 6, "inifn": 103, "behind": 288, "d2fdx2": 288, "differentiaion": 288, "backward": 288, "zero_grad": 288, "detach": 288, "requires_grad": 288, "dloss_dw": 288, "dloss_dx": 288, "lot": 288, "redund": 288, "stop_gradi": 288, "autom": 288, "sake": 288, "clariti": 288, "difficult": 288, "primit": 288, "priorit": 288, "xs": 288, "ys": 288, "naive_add": 288, "vmap_add": 288, "timeit": 288, "total": 288, "390": 288, "wherea": 288, "025": 288, "Of": 288, "handi": 288}, "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, "", "divmod"], [75, 2, 1, "", "equal"], [76, 2, 1, "", "erf"], [77, 2, 1, "", "erfinv"], [78, 2, 1, "", "eval"], [79, 2, 1, "", "exp"], [80, 2, 1, "", "expand_dims"], [81, 2, 1, "", "eye"], [94, 2, 1, "", "flatten"], [95, 2, 1, "", "floor"], [96, 2, 1, "", "floor_divide"], [97, 2, 1, "", "full"], [98, 2, 1, "", "grad"], [99, 2, 1, "", "greater"], [100, 2, 1, "", "greater_equal"], [101, 2, 1, "", "identity"], [102, 2, 1, "", "inner"], [103, 2, 1, "", "isinf"], [104, 2, 1, "", "isnan"], [105, 2, 1, "", "isneginf"], [106, 2, 1, "", "isposinf"], [107, 2, 1, "", "jvp"], [108, 2, 1, "", "less"], [109, 2, 1, "", "less_equal"], [111, 2, 1, "", "linspace"], [112, 2, 1, "", "load"], [113, 2, 1, "", "log"], [114, 2, 1, "", "log10"], [115, 2, 1, "", "log1p"], [116, 2, 1, "", "log2"], [117, 2, 1, "", "logaddexp"], [118, 2, 1, "", "logical_and"], [119, 2, 1, "", "logical_not"], [120, 2, 1, "", "logical_or"], [121, 2, 1, "", "logsumexp"], [122, 2, 1, "", "matmul"], [123, 2, 1, "", "max"], [124, 2, 1, "", "maximum"], [125, 2, 1, "", "mean"], [126, 2, 1, "", "min"], [127, 2, 1, "", "minimum"], [128, 2, 1, "", "moveaxis"], [129, 2, 1, "", "multiply"], [130, 2, 1, "", "negative"], [131, 2, 1, "", "new_stream"], [132, 2, 1, "", "ones"], [133, 2, 1, "", "ones_like"], [134, 2, 1, "", "outer"], [135, 2, 1, "", "pad"], [136, 2, 1, "", "partition"], [137, 2, 1, "", "prod"], [138, 2, 1, "", "quantize"], [139, 2, 1, "", "quantized_matmul"], [150, 2, 1, "", "reciprocal"], [151, 2, 1, "", "repeat"], [152, 2, 1, "", "reshape"], [153, 2, 1, "", "round"], [154, 2, 1, "", "rsqrt"], [155, 2, 1, "", "save"], [156, 2, 1, "", "save_gguf"], [157, 2, 1, "", "save_safetensors"], [158, 2, 1, "", "savez"], [159, 2, 1, "", "savez_compressed"], [160, 2, 1, "", "set_default_device"], [161, 2, 1, "", "set_default_stream"], [162, 2, 1, "", "sigmoid"], [163, 2, 1, "", "sign"], [164, 2, 1, "", "simplify"], [165, 2, 1, "", "sin"], [166, 2, 1, "", "sinh"], [167, 2, 1, "", "softmax"], [168, 2, 1, "", "sort"], [169, 2, 1, "", "split"], [170, 2, 1, "", "sqrt"], [171, 2, 1, "", "square"], [172, 2, 1, "", "squeeze"], [173, 2, 1, "", "stack"], [174, 2, 1, "", "stop_gradient"], [175, 2, 1, "", "subtract"], [176, 2, 1, "", "sum"], [177, 2, 1, "", "swapaxes"], [178, 2, 1, "", "take"], [179, 2, 1, "", "take_along_axis"], [180, 2, 1, "", "tan"], [181, 2, 1, "", "tanh"], [182, 2, 1, "", "tensordot"], [183, 2, 1, "", "transpose"], [184, 2, 1, "", "tri"], [185, 2, 1, "", "tril"], [186, 2, 1, "", "triu"], [187, 2, 1, "", "value_and_grad"], [188, 2, 1, "", "var"], [189, 2, 1, "", "vjp"], [190, 2, 1, "", "vmap"], [191, 2, 1, "", "where"], [192, 2, 1, "", "zeros"], [193, 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": [[82, 2, 1, "", "fft"], [83, 2, 1, "", "fft2"], [84, 2, 1, "", "fftn"], [85, 2, 1, "", "ifft"], [86, 2, 1, "", "ifft2"], [87, 2, 1, "", "ifftn"], [88, 2, 1, "", "irfft"], [89, 2, 1, "", "irfft2"], [90, 2, 1, "", "irfftn"], [91, 2, 1, "", "rfft"], [92, 2, 1, "", "rfft2"], [93, 2, 1, "", "rfftn"]], "mlx.core.linalg": [[110, 2, 1, "", "norm"]], "mlx.core.random": [[140, 2, 1, "", "bernoulli"], [141, 2, 1, "", "categorical"], [142, 2, 1, "", "gumbel"], [143, 2, 1, "", "key"], [144, 2, 1, "", "normal"], [145, 2, 1, "", "randint"], [146, 2, 1, "", "seed"], [147, 2, 1, "", "split"], [148, 2, 1, "", "truncated_normal"], [149, 2, 1, "", "uniform"]], "mlx.nn": [[214, 0, 1, "", "ALiBi"], [215, 0, 1, "", "BatchNorm"], [216, 0, 1, "", "Conv1d"], [217, 0, 1, "", "Conv2d"], [218, 0, 1, "", "Dropout"], [219, 0, 1, "", "Dropout2d"], [220, 0, 1, "", "Dropout3d"], [221, 0, 1, "", "Embedding"], [222, 0, 1, "", "GELU"], [223, 0, 1, "", "GroupNorm"], [224, 0, 1, "", "InstanceNorm"], [225, 0, 1, "", "LayerNorm"], [226, 0, 1, "", "Linear"], [227, 0, 1, "", "Mish"], [282, 0, 1, "", "Module"], [246, 0, 1, "", "MultiHeadAttention"], [247, 0, 1, "", "PReLU"], [248, 0, 1, "", "QuantizedLinear"], [249, 0, 1, "", "RMSNorm"], [250, 0, 1, "", "ReLU"], [251, 0, 1, "", "RoPE"], [252, 0, 1, "", "SELU"], [253, 0, 1, "", "Sequential"], [254, 0, 1, "", "SiLU"], [255, 0, 1, "", "SinusoidalPositionalEncoding"], [256, 0, 1, "", "Step"], [257, 0, 1, "", "Transformer"], [258, 0, 1, "", "gelu"], [259, 0, 1, "", "gelu_approx"], [260, 0, 1, "", "gelu_fast_approx"], [273, 0, 1, "", "mish"], [274, 0, 1, "", "prelu"], [275, 0, 1, "", "relu"], [276, 0, 1, "", "selu"], [277, 0, 1, "", "silu"], [278, 0, 1, "", "step"], [194, 2, 1, "", "value_and_grad"]], "mlx.nn.Module": [[228, 1, 1, "", "apply"], [229, 1, 1, "", "apply_to_modules"], [230, 1, 1, "", "children"], [231, 1, 1, "", "eval"], [232, 1, 1, "", "filter_and_map"], [233, 1, 1, "", "freeze"], [234, 1, 1, "", "leaf_modules"], [235, 1, 1, "", "load_weights"], [236, 1, 1, "", "modules"], [237, 1, 1, "", "named_modules"], [238, 1, 1, "", "parameters"], [239, 1, 1, "", "save_weights"], [240, 1, 1, "", "train"], [241, 1, 1, "", "trainable_parameters"], [242, 3, 1, "", "training"], [243, 1, 1, "", "unfreeze"], [244, 1, 1, "", "update"], [245, 1, 1, "", "update_modules"]], "mlx.nn.RoPE": [[251, 4, 1, "", "_cos_sin_theta_key"], [251, 4, 1, "", "_cos_sin_theta_value"]], "mlx.nn.losses": [[261, 0, 1, "", "binary_cross_entropy"], [262, 0, 1, "", "cosine_similarity_loss"], [263, 0, 1, "", "cross_entropy"], [264, 0, 1, "", "hinge_loss"], [265, 0, 1, "", "huber_loss"], [266, 0, 1, "", "kl_div_loss"], [267, 0, 1, "", "l1_loss"], [268, 0, 1, "", "log_cosh_loss"], [269, 0, 1, "", "mse_loss"], [270, 0, 1, "", "nll_loss"], [271, 0, 1, "", "smooth_l1_loss"], [272, 0, 1, "", "triplet_loss"]], "mlx.optimizers": [[195, 0, 1, "", "AdaDelta"], [196, 0, 1, "", "Adagrad"], [197, 0, 1, "", "Adam"], [198, 0, 1, "", "AdamW"], [199, 0, 1, "", "Adamax"], [200, 0, 1, "", "Lion"], [201, 0, 1, "", "Optimizer"], [202, 0, 1, "", "OptimizerState"], [203, 0, 1, "", "RMSprop"], [204, 0, 1, "", "SGD"]], "mlx.optimizers.Optimizer": [[201, 4, 1, "", "state"]], "mlx.utils": [[205, 2, 1, "", "tree_flatten"], [206, 2, 1, "", "tree_map"], [207, 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, 283], "develop": 1, "document": 1, "introduc": 1, "exampl": [1, 5, 294], "primit": 1, "us": [1, 290, 295], "implement": [1, 3], "cpu": 1, "backend": 1, "gpu": 1, "transform": [1, 257, 286, 288, 290, 292], "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, 212, 226], "regress": 2, "llm": 3, "infer": 3, "model": 3, "attent": 3, "layer": [3, 4, 280], "encod": 3, "full": [3, 97], "gener": 3, "put": 3, "all": [3, 12, 29], "togeth": 3, "convert": 3, "weight": 3, "load": [3, 112, 293], "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, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278], "instal": [5, 6], "api": [5, 6], "refer": 5, "c": [5, 6], "further": 5, "read": 5, "from": [6, 289], "pypi": [], "troubleshoot": 6, "sourc": 6, "requir": 6, "option": 6, "metal": 6, "found": 6, "x86": 6, "shell": 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, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193], "devic": [7, 210], "dtype": [8, 35], "stream": [9, 210, 295], "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, 208, 289, 293], "t": 27, "astyp": 33, "co": [34, 68], "exp": [36, 79], "item": 37, "log": [38, 113], "log1p": [39, 115], "logsumexp": [40, 121], "max": [41, 123], "mean": [42, 125], "min": [43, 126], "ndim": 44, "prod": [45, 137], "reciproc": [46, 150], "reshap": [47, 152], "round": [48, 153], "rsqrt": [49, 154], "shape": 50, "sin": [51, 165], "size": 52, "split": [53, 147, 169], "sqrt": [54, 170], "squar": [55, 171], "sum": [56, 176], "tolist": 57, "transpos": [58, 183], "var": [59, 188], "array_equ": 60, "broadcast_to": 61, "ceil": 62, "clip": 63, "concaten": 64, "conv1d": [65, 216], "conv2d": [66, 217], "convolv": 67, "cosh": 69, "default_devic": 70, "default_stream": 71, "dequant": 72, "divid": 73, "divmod": 74, "equal": 75, "erf": 76, "erfinv": 77, "eval": [78, 231], "expand_dim": 80, "ey": 81, "fft": [82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 211], "fft2": 83, "fftn": 84, "ifft": 85, "ifft2": 86, "ifftn": 87, "irfft": 88, "irfft2": 89, "irfftn": 90, "rfft": 91, "rfft2": 92, "rfftn": 93, "flatten": 94, "floor": 95, "floor_divid": 96, "grad": [98, 213], "greater": 99, "greater_equ": 100, "ident": 101, "inner": 102, "jvp": 107, "less": 108, "less_equ": 109, "linalg": 110, "norm": 110, "linspac": 111, "log10": 114, "log2": 116, "logaddexp": 117, "logical_and": 118, "logical_not": 119, "logical_or": 120, "matmul": 122, "maximum": 124, "minimum": 127, "moveaxi": 128, "multipli": 129, "neg": 130, "new_stream": 131, "ones": 132, "ones_lik": 133, "outer": 134, "pad": 135, "partit": 136, "quantiz": 138, "quantized_matmul": 139, "random": [140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 285], "bernoulli": 140, "categor": 141, "gumbel": 142, "kei": 143, "normal": 144, "randint": 145, "seed": 146, "truncated_norm": 148, "uniform": 149, "repeat": 151, "save": [155, 293], "save_gguf": 156, "save_safetensor": 157, "savez": 158, "savez_compress": 159, "set_default_devic": 160, "set_default_stream": 161, "sigmoid": 162, "sign": 163, "simplifi": 164, "sinh": 166, "softmax": 167, "sort": 168, "squeez": 172, "stack": 173, "stop_gradi": 174, "subtract": 175, "swapax": 177, "take": 178, "take_along_axi": 179, "tan": 180, "tanh": 181, "tensordot": 182, "tri": 184, "tril": 185, "triu": 186, "value_and_grad": [187, 194], "vjp": 189, "vmap": 190, "where": 191, "zero": 192, "zeros_lik": 193, "nn": [194, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278], "optim": [195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 284], "adadelta": 195, "adagrad": 196, "adam": 197, "adamw": 198, "adamax": 199, "lion": 200, "optimizerst": 202, "rmsprop": 203, "sgd": 204, "util": [205, 206, 207, 287], "tree_flatten": 205, "tree_map": 206, "tree_unflatten": 207, "data": 209, "type": 209, "support": 209, "algebra": 212, "neural": 213, "network": 213, "quick": [213, 292], "start": [213, 292], "The": 213, "modul": [213, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 282], "class": 213, "paramet": [213, 238], "updat": [213, 244, 289], "inspect": 213, "valu": 213, "alibi": 214, "batchnorm": 215, "dropout": 218, "dropout2d": 219, "dropout3d": 220, "embed": 221, "gelu": [222, 258], "groupnorm": 223, "instancenorm": 224, "layernorm": 225, "mish": [227, 273], "appli": 228, "apply_to_modul": 229, "children": 230, "filter_and_map": 232, "freez": 233, "leaf_modul": 234, "load_weight": 235, "named_modul": 237, "save_weight": 239, "train": [240, 242], "trainable_paramet": 241, "unfreez": 243, "update_modul": 245, "multiheadattent": 246, "prelu": [247, 274], "quantizedlinear": 248, "rmsnorm": 249, "relu": [250, 275], "rope": 251, "selu": [252, 276], "sequenti": 253, "silu": [254, 277], "sinusoidalpositionalencod": 255, "step": [256, 278], "gelu_approx": 259, "gelu_fast_approx": 260, "loss": [261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 281], "binary_cross_entropi": 261, "cosine_similarity_loss": 262, "cross_entropi": 263, "hinge_loss": 264, "huber_loss": 265, "kl_div_loss": 266, "l1_loss": 267, "log_cosh_loss": 268, "mse_loss": 269, "nll_loss": 270, "smooth_l1_loss": 271, "triplet_loss": 272, "function": [279, 281, 288, 292], "tree": 287, "index": 289, "differ": 289, "numpi": [289, 291], "In": 289, "place": 289, "lazi": 290, "evalu": 290, "why": 290, "comput": 290, "graph": [290, 292], "onli": 290, "what": 290, "you": 290, "when": 290, "convers": 291, "other": 291, "framework": 291, "pytorch": 291, "jax": 291, "tensorflow": 291, "guid": 292, "basic": 292, "serial": 293, "format": 293, "unifi": 294, "memori": 294, "A": 294, "simpl": 294, "specifi": 295, "isinf": 103, "isnan": 104, "isneginf": 105, "isposinf": 106, "automat": 288, "differenti": 288, "vector": 288}, "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}})