From ec5aab00714fef9731a7fb2b60b67b882d8b45f2 Mon Sep 17 00:00:00 2001 From: Awni Hannun Date: Fri, 26 Apr 2024 08:24:09 -0700 Subject: [PATCH] docs update --- docs/build/html/.buildinfo | 2 +- .../html/_sources/dev/metal_debugger.rst | 7 +- docs/build/html/_sources/install.rst | 16 +- .../_autosummary/mlx.core.block_masked_mm.rst | 6 + .../python/_autosummary/mlx.core.degrees.rst | 6 + .../mlx.core.metal.clear_cache.rst | 6 + .../_autosummary/mlx.core.not_equal.rst | 6 + .../python/_autosummary/mlx.core.radians.rst | 6 + .../_autosummary/mlx.core.synchronize.rst | 6 + .../python/_autosummary/mlx.nn.quantize.rst | 6 + .../mlx.utils.tree_map_with_path.rst | 6 + .../_sources/python/devices_and_streams.rst | 1 + docs/build/html/_sources/python/metal.rst | 1 + docs/build/html/_sources/python/nn.rst | 1 + .../python/nn/_autosummary/mlx.nn.ALiBi.rst | 14 +- .../nn/_autosummary/mlx.nn.AvgPool1d.rst | 12 +- .../nn/_autosummary/mlx.nn.AvgPool2d.rst | 12 +- .../nn/_autosummary/mlx.nn.BatchNorm.rst | 13 +- .../python/nn/_autosummary/mlx.nn.Conv1d.rst | 12 +- .../python/nn/_autosummary/mlx.nn.Conv2d.rst | 12 +- .../python/nn/_autosummary/mlx.nn.Dropout.rst | 12 +- .../nn/_autosummary/mlx.nn.Dropout2d.rst | 12 +- .../nn/_autosummary/mlx.nn.Dropout3d.rst | 12 +- .../nn/_autosummary/mlx.nn.Embedding.rst | 13 +- .../python/nn/_autosummary/mlx.nn.GELU.rst | 12 +- .../python/nn/_autosummary/mlx.nn.GRU.rst | 12 +- .../nn/_autosummary/mlx.nn.GroupNorm.rst | 12 +- .../nn/_autosummary/mlx.nn.InstanceNorm.rst | 12 +- .../python/nn/_autosummary/mlx.nn.LSTM.rst | 12 +- .../nn/_autosummary/mlx.nn.LayerNorm.rst | 12 +- .../python/nn/_autosummary/mlx.nn.Linear.rst | 12 +- .../nn/_autosummary/mlx.nn.MaxPool1d.rst | 12 +- .../nn/_autosummary/mlx.nn.MaxPool2d.rst | 12 +- .../python/nn/_autosummary/mlx.nn.Mish.rst | 12 +- .../mlx.nn.MultiHeadAttention.rst | 13 +- .../python/nn/_autosummary/mlx.nn.PReLU.rst | 12 +- .../mlx.nn.QuantizedEmbedding.rst | 18 + .../_autosummary/mlx.nn.QuantizedLinear.rst | 14 +- .../python/nn/_autosummary/mlx.nn.RMSNorm.rst | 12 +- .../python/nn/_autosummary/mlx.nn.RNN.rst | 12 +- .../python/nn/_autosummary/mlx.nn.ReLU.rst | 12 +- .../python/nn/_autosummary/mlx.nn.RoPE.rst | 12 +- .../python/nn/_autosummary/mlx.nn.SELU.rst | 12 +- .../nn/_autosummary/mlx.nn.Sequential.rst | 12 +- .../python/nn/_autosummary/mlx.nn.SiLU.rst | 12 +- .../mlx.nn.SinusoidalPositionalEncoding.rst | 12 +- .../nn/_autosummary/mlx.nn.Softshrink.rst | 12 +- .../python/nn/_autosummary/mlx.nn.Step.rst | 12 +- .../nn/_autosummary/mlx.nn.Transformer.rst | 12 +- .../nn/_autosummary/mlx.nn.Upsample.rst | 12 +- .../nn/_autosummary_functions/mlx.nn.elu.rst | 7 +- .../nn/_autosummary_functions/mlx.nn.gelu.rst | 7 +- .../mlx.nn.gelu_approx.rst | 7 +- .../mlx.nn.gelu_fast_approx.rst | 7 +- .../nn/_autosummary_functions/mlx.nn.glu.rst | 7 +- .../mlx.nn.hardswish.rst | 7 +- .../mlx.nn.leaky_relu.rst | 7 +- .../mlx.nn.log_sigmoid.rst | 7 +- .../mlx.nn.log_softmax.rst | 7 +- .../mlx.nn.losses.binary_cross_entropy.rst | 7 +- .../mlx.nn.losses.cosine_similarity_loss.rst | 7 +- .../mlx.nn.losses.cross_entropy.rst | 7 +- .../mlx.nn.losses.gaussian_nll_loss.rst | 7 +- .../mlx.nn.losses.hinge_loss.rst | 7 +- .../mlx.nn.losses.huber_loss.rst | 7 +- .../mlx.nn.losses.kl_div_loss.rst | 7 +- .../mlx.nn.losses.l1_loss.rst | 7 +- .../mlx.nn.losses.log_cosh_loss.rst | 7 +- .../mlx.nn.losses.margin_ranking_loss.rst | 7 +- .../mlx.nn.losses.mse_loss.rst | 7 +- .../mlx.nn.losses.nll_loss.rst | 7 +- .../mlx.nn.losses.smooth_l1_loss.rst | 7 +- .../mlx.nn.losses.triplet_loss.rst | 7 +- .../nn/_autosummary_functions/mlx.nn.mish.rst | 7 +- .../_autosummary_functions/mlx.nn.prelu.rst | 7 +- .../nn/_autosummary_functions/mlx.nn.relu.rst | 7 +- .../_autosummary_functions/mlx.nn.relu6.rst | 7 +- .../nn/_autosummary_functions/mlx.nn.selu.rst | 7 +- .../_autosummary_functions/mlx.nn.sigmoid.rst | 7 +- .../nn/_autosummary_functions/mlx.nn.silu.rst | 7 +- .../_autosummary_functions/mlx.nn.softmax.rst | 7 +- .../mlx.nn.softplus.rst | 7 +- .../mlx.nn.softshrink.rst | 7 +- .../nn/_autosummary_functions/mlx.nn.step.rst | 7 +- .../nn/_autosummary_functions/mlx.nn.tanh.rst | 7 +- docs/build/html/_sources/python/nn/layers.rst | 3 +- docs/build/html/_sources/python/ops.rst | 4 + .../build/html/_sources/python/tree_utils.rst | 1 + .../_sphinx_javascript_frameworks_compat.js | 134 - .../html/_static/documentation_options.js | 2 +- docs/build/html/_static/jquery-3.6.0.js | 10881 ---------------- docs/build/html/_static/jquery.js | 2 - docs/build/html/_static/underscore-1.13.1.js | 2042 --- docs/build/html/_static/underscore.js | 6 - docs/build/html/cpp/ops.html | 23 +- docs/build/html/dev/extensions.html | 17 +- docs/build/html/dev/metal_debugger.html | 24 +- .../html/examples/linear_regression.html | 17 +- docs/build/html/examples/llama-inference.html | 17 +- docs/build/html/examples/mlp.html | 17 +- docs/build/html/genindex.html | 131 +- docs/build/html/index.html | 17 +- docs/build/html/install.html | 19 +- docs/build/html/objects.inv | Bin 9586 -> 9826 bytes .../python/_autosummary/mlx.core.Device.html | 17 +- .../python/_autosummary/mlx.core.Dtype.html | 17 +- .../_autosummary/mlx.core.DtypeCategory.html | 17 +- .../python/_autosummary/mlx.core.Stream.html | 23 +- .../python/_autosummary/mlx.core.abs.html | 17 +- .../python/_autosummary/mlx.core.add.html | 17 +- .../python/_autosummary/mlx.core.all.html | 17 +- .../_autosummary/mlx.core.allclose.html | 17 +- .../python/_autosummary/mlx.core.any.html | 17 +- .../python/_autosummary/mlx.core.arange.html | 17 +- .../python/_autosummary/mlx.core.arccos.html | 17 +- .../python/_autosummary/mlx.core.arccosh.html | 17 +- .../python/_autosummary/mlx.core.arcsin.html | 17 +- .../python/_autosummary/mlx.core.arcsinh.html | 17 +- .../python/_autosummary/mlx.core.arctan.html | 17 +- .../python/_autosummary/mlx.core.arctanh.html | 17 +- .../python/_autosummary/mlx.core.argmax.html | 17 +- .../python/_autosummary/mlx.core.argmin.html | 17 +- .../_autosummary/mlx.core.argpartition.html | 17 +- .../python/_autosummary/mlx.core.argsort.html | 17 +- .../python/_autosummary/mlx.core.array.T.html | 17 +- .../_autosummary/mlx.core.array.abs.html | 17 +- .../_autosummary/mlx.core.array.all.html | 17 +- .../_autosummary/mlx.core.array.any.html | 17 +- .../_autosummary/mlx.core.array.argmax.html | 17 +- .../_autosummary/mlx.core.array.argmin.html | 17 +- .../_autosummary/mlx.core.array.astype.html | 17 +- .../_autosummary/mlx.core.array.at.html | 17 +- .../_autosummary/mlx.core.array.cos.html | 17 +- .../_autosummary/mlx.core.array.cummax.html | 17 +- .../_autosummary/mlx.core.array.cummin.html | 17 +- .../_autosummary/mlx.core.array.cumprod.html | 17 +- .../_autosummary/mlx.core.array.cumsum.html | 17 +- .../_autosummary/mlx.core.array.diag.html | 17 +- .../_autosummary/mlx.core.array.diagonal.html | 17 +- .../_autosummary/mlx.core.array.dtype.html | 17 +- .../_autosummary/mlx.core.array.exp.html | 17 +- .../_autosummary/mlx.core.array.flatten.html | 17 +- .../python/_autosummary/mlx.core.array.html | 17 +- .../_autosummary/mlx.core.array.item.html | 17 +- .../_autosummary/mlx.core.array.itemsize.html | 17 +- .../_autosummary/mlx.core.array.log.html | 17 +- .../_autosummary/mlx.core.array.log10.html | 17 +- .../_autosummary/mlx.core.array.log1p.html | 17 +- .../_autosummary/mlx.core.array.log2.html | 17 +- .../mlx.core.array.logsumexp.html | 17 +- .../_autosummary/mlx.core.array.max.html | 17 +- .../_autosummary/mlx.core.array.mean.html | 17 +- .../_autosummary/mlx.core.array.min.html | 17 +- .../_autosummary/mlx.core.array.moveaxis.html | 17 +- .../_autosummary/mlx.core.array.nbytes.html | 17 +- .../_autosummary/mlx.core.array.ndim.html | 17 +- .../_autosummary/mlx.core.array.prod.html | 17 +- .../mlx.core.array.reciprocal.html | 17 +- .../_autosummary/mlx.core.array.reshape.html | 17 +- .../_autosummary/mlx.core.array.round.html | 17 +- .../_autosummary/mlx.core.array.rsqrt.html | 17 +- .../_autosummary/mlx.core.array.shape.html | 17 +- .../_autosummary/mlx.core.array.sin.html | 17 +- .../_autosummary/mlx.core.array.size.html | 17 +- .../_autosummary/mlx.core.array.split.html | 17 +- .../_autosummary/mlx.core.array.sqrt.html | 17 +- .../_autosummary/mlx.core.array.square.html | 17 +- .../_autosummary/mlx.core.array.squeeze.html | 17 +- .../_autosummary/mlx.core.array.sum.html | 17 +- .../_autosummary/mlx.core.array.swapaxes.html | 17 +- .../_autosummary/mlx.core.array.tolist.html | 17 +- .../mlx.core.array.transpose.html | 17 +- .../_autosummary/mlx.core.array.var.html | 17 +- .../_autosummary/mlx.core.array_equal.html | 17 +- .../_autosummary/mlx.core.atleast_1d.html | 17 +- .../_autosummary/mlx.core.atleast_2d.html | 17 +- .../_autosummary/mlx.core.atleast_3d.html | 17 +- .../mlx.core.block_masked_mm.html | 920 ++ .../_autosummary/mlx.core.broadcast_to.html | 23 +- .../python/_autosummary/mlx.core.ceil.html | 23 +- .../python/_autosummary/mlx.core.clip.html | 17 +- .../python/_autosummary/mlx.core.compile.html | 17 +- .../_autosummary/mlx.core.concatenate.html | 17 +- .../python/_autosummary/mlx.core.conv1d.html | 17 +- .../python/_autosummary/mlx.core.conv2d.html | 17 +- .../_autosummary/mlx.core.conv_general.html | 17 +- .../_autosummary/mlx.core.convolve.html | 17 +- .../python/_autosummary/mlx.core.cos.html | 17 +- .../python/_autosummary/mlx.core.cosh.html | 17 +- .../python/_autosummary/mlx.core.cummax.html | 17 +- .../python/_autosummary/mlx.core.cummin.html | 17 +- .../python/_autosummary/mlx.core.cumprod.html | 17 +- .../python/_autosummary/mlx.core.cumsum.html | 23 +- .../_autosummary/mlx.core.default_device.html | 17 +- .../_autosummary/mlx.core.default_stream.html | 17 +- .../python/_autosummary/mlx.core.degrees.html | 909 ++ .../_autosummary/mlx.core.dequantize.html | 23 +- .../python/_autosummary/mlx.core.diag.html | 17 +- .../_autosummary/mlx.core.diagonal.html | 17 +- .../mlx.core.disable_compile.html | 17 +- .../python/_autosummary/mlx.core.divide.html | 17 +- .../python/_autosummary/mlx.core.divmod.html | 17 +- .../_autosummary/mlx.core.enable_compile.html | 17 +- .../python/_autosummary/mlx.core.equal.html | 17 +- .../python/_autosummary/mlx.core.erf.html | 17 +- .../python/_autosummary/mlx.core.erfinv.html | 17 +- .../python/_autosummary/mlx.core.eval.html | 17 +- .../python/_autosummary/mlx.core.exp.html | 17 +- .../_autosummary/mlx.core.expand_dims.html | 17 +- .../python/_autosummary/mlx.core.expm1.html | 17 +- .../python/_autosummary/mlx.core.eye.html | 17 +- .../mlx.core.fast.layer_norm.html | 17 +- .../_autosummary/mlx.core.fast.rms_norm.html | 17 +- .../_autosummary/mlx.core.fast.rope.html | 17 +- ...ore.fast.scaled_dot_product_attention.html | 17 +- .../python/_autosummary/mlx.core.fft.fft.html | 17 +- .../_autosummary/mlx.core.fft.fft2.html | 17 +- .../_autosummary/mlx.core.fft.fftn.html | 17 +- .../_autosummary/mlx.core.fft.ifft.html | 17 +- .../_autosummary/mlx.core.fft.ifft2.html | 17 +- .../_autosummary/mlx.core.fft.ifftn.html | 17 +- .../_autosummary/mlx.core.fft.irfft.html | 17 +- .../_autosummary/mlx.core.fft.irfft2.html | 17 +- .../_autosummary/mlx.core.fft.irfftn.html | 17 +- .../_autosummary/mlx.core.fft.rfft.html | 17 +- .../_autosummary/mlx.core.fft.rfft2.html | 17 +- .../_autosummary/mlx.core.fft.rfftn.html | 17 +- .../python/_autosummary/mlx.core.flatten.html | 17 +- .../python/_autosummary/mlx.core.floor.html | 17 +- .../_autosummary/mlx.core.floor_divide.html | 17 +- .../python/_autosummary/mlx.core.full.html | 17 +- .../python/_autosummary/mlx.core.grad.html | 17 +- .../python/_autosummary/mlx.core.greater.html | 17 +- .../_autosummary/mlx.core.greater_equal.html | 17 +- .../_autosummary/mlx.core.identity.html | 17 +- .../python/_autosummary/mlx.core.inner.html | 17 +- .../python/_autosummary/mlx.core.isclose.html | 17 +- .../python/_autosummary/mlx.core.isinf.html | 17 +- .../python/_autosummary/mlx.core.isnan.html | 17 +- .../_autosummary/mlx.core.isneginf.html | 17 +- .../_autosummary/mlx.core.isposinf.html | 17 +- .../_autosummary/mlx.core.issubdtype.html | 17 +- .../python/_autosummary/mlx.core.jvp.html | 17 +- .../python/_autosummary/mlx.core.less.html | 17 +- .../_autosummary/mlx.core.less_equal.html | 17 +- .../_autosummary/mlx.core.linalg.norm.html | 17 +- .../_autosummary/mlx.core.linalg.qr.html | 17 +- .../_autosummary/mlx.core.linspace.html | 17 +- .../python/_autosummary/mlx.core.load.html | 17 +- .../python/_autosummary/mlx.core.log.html | 17 +- .../python/_autosummary/mlx.core.log10.html | 17 +- .../python/_autosummary/mlx.core.log1p.html | 17 +- .../python/_autosummary/mlx.core.log2.html | 17 +- .../_autosummary/mlx.core.logaddexp.html | 17 +- .../_autosummary/mlx.core.logical_and.html | 17 +- .../_autosummary/mlx.core.logical_not.html | 17 +- .../_autosummary/mlx.core.logical_or.html | 17 +- .../_autosummary/mlx.core.logsumexp.html | 17 +- .../python/_autosummary/mlx.core.matmul.html | 17 +- .../python/_autosummary/mlx.core.max.html | 17 +- .../python/_autosummary/mlx.core.maximum.html | 17 +- .../python/_autosummary/mlx.core.mean.html | 17 +- .../_autosummary/mlx.core.meshgrid.html | 17 +- .../mlx.core.metal.clear_cache.html | 899 ++ .../mlx.core.metal.get_active_memory.html | 17 +- .../mlx.core.metal.get_cache_memory.html | 17 +- .../mlx.core.metal.get_peak_memory.html | 17 +- .../mlx.core.metal.is_available.html | 17 +- .../mlx.core.metal.set_cache_limit.html | 23 +- .../mlx.core.metal.set_memory_limit.html | 17 +- .../mlx.core.metal.start_capture.html | 31 +- .../mlx.core.metal.stop_capture.html | 17 +- .../python/_autosummary/mlx.core.min.html | 17 +- .../python/_autosummary/mlx.core.minimum.html | 17 +- .../_autosummary/mlx.core.moveaxis.html | 17 +- .../_autosummary/mlx.core.multiply.html | 17 +- .../_autosummary/mlx.core.negative.html | 23 +- .../_autosummary/mlx.core.new_stream.html | 17 +- .../_autosummary/mlx.core.not_equal.html | 914 ++ .../python/_autosummary/mlx.core.ones.html | 23 +- .../_autosummary/mlx.core.ones_like.html | 17 +- .../python/_autosummary/mlx.core.outer.html | 17 +- .../python/_autosummary/mlx.core.pad.html | 17 +- .../_autosummary/mlx.core.partition.html | 17 +- .../python/_autosummary/mlx.core.prod.html | 17 +- .../_autosummary/mlx.core.quantize.html | 17 +- .../mlx.core.quantized_matmul.html | 23 +- .../python/_autosummary/mlx.core.radians.html | 909 ++ .../mlx.core.random.bernoulli.html | 17 +- .../mlx.core.random.categorical.html | 17 +- .../_autosummary/mlx.core.random.gumbel.html | 17 +- .../_autosummary/mlx.core.random.key.html | 17 +- .../mlx.core.random.multivariate_normal.html | 17 +- .../_autosummary/mlx.core.random.normal.html | 17 +- .../_autosummary/mlx.core.random.randint.html | 17 +- .../_autosummary/mlx.core.random.seed.html | 17 +- .../_autosummary/mlx.core.random.split.html | 17 +- .../mlx.core.random.truncated_normal.html | 17 +- .../_autosummary/mlx.core.random.uniform.html | 17 +- .../_autosummary/mlx.core.reciprocal.html | 23 +- .../python/_autosummary/mlx.core.repeat.html | 17 +- .../python/_autosummary/mlx.core.reshape.html | 17 +- .../python/_autosummary/mlx.core.round.html | 17 +- .../python/_autosummary/mlx.core.rsqrt.html | 17 +- .../python/_autosummary/mlx.core.save.html | 17 +- .../_autosummary/mlx.core.save_gguf.html | 17 +- .../mlx.core.save_safetensors.html | 17 +- .../python/_autosummary/mlx.core.savez.html | 17 +- .../mlx.core.savez_compressed.html | 17 +- .../mlx.core.set_default_device.html | 17 +- .../mlx.core.set_default_stream.html | 17 +- .../python/_autosummary/mlx.core.sigmoid.html | 17 +- .../python/_autosummary/mlx.core.sign.html | 17 +- .../python/_autosummary/mlx.core.sin.html | 17 +- .../python/_autosummary/mlx.core.sinh.html | 17 +- .../python/_autosummary/mlx.core.softmax.html | 17 +- .../python/_autosummary/mlx.core.sort.html | 17 +- .../python/_autosummary/mlx.core.split.html | 17 +- .../python/_autosummary/mlx.core.sqrt.html | 17 +- .../python/_autosummary/mlx.core.square.html | 17 +- .../python/_autosummary/mlx.core.squeeze.html | 17 +- .../python/_autosummary/mlx.core.stack.html | 17 +- .../python/_autosummary/mlx.core.std.html | 17 +- .../_autosummary/mlx.core.stop_gradient.html | 17 +- .../_autosummary/mlx.core.subtract.html | 17 +- .../python/_autosummary/mlx.core.sum.html | 17 +- .../_autosummary/mlx.core.swapaxes.html | 17 +- .../_autosummary/mlx.core.synchronize.html | 905 ++ .../python/_autosummary/mlx.core.take.html | 17 +- .../mlx.core.take_along_axis.html | 17 +- .../python/_autosummary/mlx.core.tan.html | 17 +- .../python/_autosummary/mlx.core.tanh.html | 17 +- .../_autosummary/mlx.core.tensordot.html | 17 +- .../python/_autosummary/mlx.core.tile.html | 17 +- .../python/_autosummary/mlx.core.topk.html | 17 +- .../_autosummary/mlx.core.transpose.html | 17 +- .../python/_autosummary/mlx.core.tri.html | 17 +- .../python/_autosummary/mlx.core.tril.html | 17 +- .../python/_autosummary/mlx.core.triu.html | 17 +- .../_autosummary/mlx.core.value_and_grad.html | 17 +- .../python/_autosummary/mlx.core.var.html | 17 +- .../python/_autosummary/mlx.core.vjp.html | 17 +- .../python/_autosummary/mlx.core.vmap.html | 17 +- .../python/_autosummary/mlx.core.where.html | 17 +- .../python/_autosummary/mlx.core.zeros.html | 17 +- .../_autosummary/mlx.core.zeros_like.html | 17 +- .../python/_autosummary/mlx.nn.quantize.html | 915 ++ .../_autosummary/mlx.nn.value_and_grad.html | 23 +- .../_autosummary/mlx.utils.tree_flatten.html | 27 +- .../_autosummary/mlx.utils.tree_map.html | 37 +- .../mlx.utils.tree_map_with_path.html | 925 ++ .../mlx.utils.tree_unflatten.html | 23 +- .../python/_autosummary/stream_class.html | 17 +- docs/build/html/python/array.html | 17 +- docs/build/html/python/data_types.html | 17 +- .../html/python/devices_and_streams.html | 20 +- docs/build/html/python/fast.html | 17 +- docs/build/html/python/fft.html | 17 +- docs/build/html/python/linalg.html | 17 +- docs/build/html/python/metal.html | 24 +- docs/build/html/python/nn.html | 94 +- .../python/nn/_autosummary/mlx.nn.ALiBi.html | 30 +- .../nn/_autosummary/mlx.nn.AvgPool1d.html | 22 +- .../nn/_autosummary/mlx.nn.AvgPool2d.html | 24 +- .../nn/_autosummary/mlx.nn.BatchNorm.html | 25 +- .../python/nn/_autosummary/mlx.nn.Conv1d.html | 22 +- .../python/nn/_autosummary/mlx.nn.Conv2d.html | 22 +- .../nn/_autosummary/mlx.nn.Dropout.html | 22 +- .../nn/_autosummary/mlx.nn.Dropout2d.html | 22 +- .../nn/_autosummary/mlx.nn.Dropout3d.html | 22 +- .../nn/_autosummary/mlx.nn.Embedding.html | 25 +- .../python/nn/_autosummary/mlx.nn.GELU.html | 24 +- .../python/nn/_autosummary/mlx.nn.GRU.html | 22 +- .../nn/_autosummary/mlx.nn.GroupNorm.html | 22 +- .../nn/_autosummary/mlx.nn.InstanceNorm.html | 22 +- .../python/nn/_autosummary/mlx.nn.LSTM.html | 22 +- .../nn/_autosummary/mlx.nn.LayerNorm.html | 22 +- .../python/nn/_autosummary/mlx.nn.Linear.html | 22 +- .../nn/_autosummary/mlx.nn.MaxPool1d.html | 22 +- .../nn/_autosummary/mlx.nn.MaxPool2d.html | 22 +- .../python/nn/_autosummary/mlx.nn.Mish.html | 22 +- .../nn/_autosummary/mlx.nn.Module.apply.html | 17 +- .../mlx.nn.Module.apply_to_modules.html | 17 +- .../_autosummary/mlx.nn.Module.children.html | 17 +- .../nn/_autosummary/mlx.nn.Module.eval.html | 17 +- .../mlx.nn.Module.filter_and_map.html | 17 +- .../nn/_autosummary/mlx.nn.Module.freeze.html | 17 +- .../mlx.nn.Module.leaf_modules.html | 17 +- .../mlx.nn.Module.load_weights.html | 17 +- .../_autosummary/mlx.nn.Module.modules.html | 17 +- .../mlx.nn.Module.named_modules.html | 17 +- .../mlx.nn.Module.parameters.html | 17 +- .../mlx.nn.Module.save_weights.html | 17 +- .../_autosummary/mlx.nn.Module.set_dtype.html | 17 +- .../nn/_autosummary/mlx.nn.Module.state.html | 17 +- .../nn/_autosummary/mlx.nn.Module.train.html | 17 +- .../mlx.nn.Module.trainable_parameters.html | 17 +- .../_autosummary/mlx.nn.Module.training.html | 17 +- .../_autosummary/mlx.nn.Module.unfreeze.html | 17 +- .../nn/_autosummary/mlx.nn.Module.update.html | 17 +- .../mlx.nn.Module.update_modules.html | 17 +- .../mlx.nn.MultiHeadAttention.html | 25 +- .../python/nn/_autosummary/mlx.nn.PReLU.html | 28 +- .../mlx.nn.QuantizedEmbedding.html | 925 ++ .../_autosummary/mlx.nn.QuantizedLinear.html | 54 +- .../nn/_autosummary/mlx.nn.RMSNorm.html | 22 +- .../python/nn/_autosummary/mlx.nn.RNN.html | 22 +- .../python/nn/_autosummary/mlx.nn.ReLU.html | 22 +- .../python/nn/_autosummary/mlx.nn.RoPE.html | 22 +- .../python/nn/_autosummary/mlx.nn.SELU.html | 22 +- .../nn/_autosummary/mlx.nn.Sequential.html | 22 +- .../python/nn/_autosummary/mlx.nn.SiLU.html | 22 +- .../mlx.nn.SinusoidalPositionalEncoding.html | 22 +- .../nn/_autosummary/mlx.nn.Softshrink.html | 22 +- .../python/nn/_autosummary/mlx.nn.Step.html | 22 +- .../nn/_autosummary/mlx.nn.Transformer.html | 22 +- .../nn/_autosummary/mlx.nn.Upsample.html | 22 +- .../nn/_autosummary/mlx.nn.init.constant.html | 17 +- .../mlx.nn.init.glorot_normal.html | 17 +- .../mlx.nn.init.glorot_uniform.html | 17 +- .../_autosummary/mlx.nn.init.he_normal.html | 17 +- .../_autosummary/mlx.nn.init.he_uniform.html | 17 +- .../nn/_autosummary/mlx.nn.init.identity.html | 17 +- .../nn/_autosummary/mlx.nn.init.normal.html | 17 +- .../nn/_autosummary/mlx.nn.init.uniform.html | 17 +- .../nn/_autosummary_functions/mlx.nn.elu.html | 25 +- .../_autosummary_functions/mlx.nn.gelu.html | 25 +- .../mlx.nn.gelu_approx.html | 30 +- .../mlx.nn.gelu_fast_approx.html | 25 +- .../nn/_autosummary_functions/mlx.nn.glu.html | 25 +- .../mlx.nn.hardswish.html | 25 +- .../mlx.nn.leaky_relu.html | 25 +- .../mlx.nn.log_sigmoid.html | 25 +- .../mlx.nn.log_softmax.html | 25 +- .../mlx.nn.losses.binary_cross_entropy.html | 25 +- .../mlx.nn.losses.cosine_similarity_loss.html | 25 +- .../mlx.nn.losses.cross_entropy.html | 25 +- .../mlx.nn.losses.gaussian_nll_loss.html | 25 +- .../mlx.nn.losses.hinge_loss.html | 25 +- .../mlx.nn.losses.huber_loss.html | 25 +- .../mlx.nn.losses.kl_div_loss.html | 25 +- .../mlx.nn.losses.l1_loss.html | 25 +- .../mlx.nn.losses.log_cosh_loss.html | 25 +- .../mlx.nn.losses.margin_ranking_loss.html | 25 +- .../mlx.nn.losses.mse_loss.html | 25 +- .../mlx.nn.losses.nll_loss.html | 25 +- .../mlx.nn.losses.smooth_l1_loss.html | 25 +- .../mlx.nn.losses.triplet_loss.html | 25 +- .../_autosummary_functions/mlx.nn.mish.html | 25 +- .../_autosummary_functions/mlx.nn.prelu.html | 25 +- .../_autosummary_functions/mlx.nn.relu.html | 25 +- .../_autosummary_functions/mlx.nn.relu6.html | 25 +- .../_autosummary_functions/mlx.nn.selu.html | 25 +- .../mlx.nn.sigmoid.html | 25 +- .../_autosummary_functions/mlx.nn.silu.html | 25 +- .../mlx.nn.softmax.html | 25 +- .../mlx.nn.softplus.html | 25 +- .../mlx.nn.softshrink.html | 25 +- .../_autosummary_functions/mlx.nn.step.html | 25 +- .../_autosummary_functions/mlx.nn.tanh.html | 25 +- docs/build/html/python/nn/functions.html | 17 +- docs/build/html/python/nn/init.html | 17 +- docs/build/html/python/nn/layers.html | 46 +- docs/build/html/python/nn/losses.html | 17 +- docs/build/html/python/nn/module.html | 23 +- docs/build/html/python/ops.html | 77 +- docs/build/html/python/optimizers.html | 17 +- .../_autosummary/mlx.optimizers.AdaDelta.html | 17 +- .../mlx.optimizers.Adafactor.html | 17 +- .../_autosummary/mlx.optimizers.Adagrad.html | 17 +- .../_autosummary/mlx.optimizers.Adam.html | 17 +- .../_autosummary/mlx.optimizers.AdamW.html | 17 +- .../_autosummary/mlx.optimizers.Adamax.html | 17 +- .../_autosummary/mlx.optimizers.Lion.html | 17 +- ....optimizers.Optimizer.apply_gradients.html | 17 +- .../mlx.optimizers.Optimizer.init.html | 17 +- .../mlx.optimizers.Optimizer.state.html | 17 +- .../mlx.optimizers.Optimizer.update.html | 17 +- .../_autosummary/mlx.optimizers.RMSprop.html | 17 +- .../_autosummary/mlx.optimizers.SGD.html | 17 +- .../mlx.optimizers.cosine_decay.html | 17 +- .../mlx.optimizers.exponential_decay.html | 17 +- .../mlx.optimizers.join_schedules.html | 17 +- .../mlx.optimizers.linear_schedule.html | 17 +- .../mlx.optimizers.step_decay.html | 17 +- .../python/optimizers/common_optimizers.html | 17 +- .../html/python/optimizers/optimizer.html | 17 +- .../html/python/optimizers/schedulers.html | 17 +- docs/build/html/python/random.html | 17 +- docs/build/html/python/transforms.html | 17 +- docs/build/html/python/tree_utils.html | 26 +- docs/build/html/search.html | 17 +- docs/build/html/searchindex.js | 2 +- docs/build/html/usage/compile.html | 17 +- .../build/html/usage/function_transforms.html | 17 +- docs/build/html/usage/indexing.html | 17 +- docs/build/html/usage/lazy_evaluation.html | 17 +- docs/build/html/usage/numpy.html | 17 +- docs/build/html/usage/quick_start.html | 17 +- docs/build/html/usage/saving_and_loading.html | 17 +- docs/build/html/usage/unified_memory.html | 17 +- docs/build/html/usage/using_streams.html | 17 +- 502 files changed, 14665 insertions(+), 15103 deletions(-) create mode 100644 docs/build/html/_sources/python/_autosummary/mlx.core.block_masked_mm.rst create mode 100644 docs/build/html/_sources/python/_autosummary/mlx.core.degrees.rst create mode 100644 docs/build/html/_sources/python/_autosummary/mlx.core.metal.clear_cache.rst create mode 100644 docs/build/html/_sources/python/_autosummary/mlx.core.not_equal.rst create mode 100644 docs/build/html/_sources/python/_autosummary/mlx.core.radians.rst create mode 100644 docs/build/html/_sources/python/_autosummary/mlx.core.synchronize.rst create mode 100644 docs/build/html/_sources/python/_autosummary/mlx.nn.quantize.rst create mode 100644 docs/build/html/_sources/python/_autosummary/mlx.utils.tree_map_with_path.rst create mode 100644 docs/build/html/_sources/python/nn/_autosummary/mlx.nn.QuantizedEmbedding.rst delete mode 100644 docs/build/html/_static/_sphinx_javascript_frameworks_compat.js delete mode 100644 docs/build/html/_static/jquery-3.6.0.js delete mode 100644 docs/build/html/_static/jquery.js delete mode 100644 docs/build/html/_static/underscore-1.13.1.js delete mode 100644 docs/build/html/_static/underscore.js create mode 100644 docs/build/html/python/_autosummary/mlx.core.block_masked_mm.html create mode 100644 docs/build/html/python/_autosummary/mlx.core.degrees.html create mode 100644 docs/build/html/python/_autosummary/mlx.core.metal.clear_cache.html create mode 100644 docs/build/html/python/_autosummary/mlx.core.not_equal.html create mode 100644 docs/build/html/python/_autosummary/mlx.core.radians.html create mode 100644 docs/build/html/python/_autosummary/mlx.core.synchronize.html create mode 100644 docs/build/html/python/_autosummary/mlx.nn.quantize.html create mode 100644 docs/build/html/python/_autosummary/mlx.utils.tree_map_with_path.html create mode 100644 docs/build/html/python/nn/_autosummary/mlx.nn.QuantizedEmbedding.html diff --git a/docs/build/html/.buildinfo b/docs/build/html/.buildinfo index ba59ddb17..5a4af442a 100644 --- a/docs/build/html/.buildinfo +++ b/docs/build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 130317d5cc5607ddb0ed4187804765bc +config: 0c08faf7a4a5981ee1e4c3cab57ef3b9 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/build/html/_sources/dev/metal_debugger.rst b/docs/build/html/_sources/dev/metal_debugger.rst index 94d25258c..df4b98822 100644 --- a/docs/build/html/_sources/dev/metal_debugger.rst +++ b/docs/build/html/_sources/dev/metal_debugger.rst @@ -32,10 +32,9 @@ work. trace_file = "mlx_trace.gputrace" - if not mx.metal.start_capture(trace_file): - print("Make sure to run with MTL_CAPTURE_ENABLED=1 and " - f"that the path {trace_file} does not already exist.") - exit(1) + # Make sure to run with MTL_CAPTURE_ENABLED=1 and + # that the path trace_file does not already exist. + mx.metal.start_capture(trace_file) for _ in range(10): mx.eval(mx.add(a, b)) diff --git a/docs/build/html/_sources/install.rst b/docs/build/html/_sources/install.rst index 7001d896f..f34db7270 100644 --- a/docs/build/html/_sources/install.rst +++ b/docs/build/html/_sources/install.rst @@ -74,7 +74,7 @@ Install `nanobind `_ with: .. code-block:: shell - pip install git+https://github.com/wjakob/nanobind.git + pip install git+https://github.com/wjakob/nanobind.git@2f04eac452a6d9142dedb957701bdb20125561e4 Then simply build and install MLX using pip: @@ -120,7 +120,7 @@ Create a build directory and run CMake and make: .. code-block:: shell mkdir -p build && cd build - cmake .. && make -j + cmake .. && make -j Run tests with: @@ -139,7 +139,7 @@ directory as the executable statically linked to ``libmlx.a`` or the preprocessor constant ``METAL_PATH`` should be defined at build time and it should point to the path to the built metal library. -.. list-table:: Build Options +.. list-table:: Build Options :widths: 25 8 :header-rows: 1 @@ -161,15 +161,15 @@ should point to the path to the built metal library. .. note:: - If you have multiple Xcode installations and wish to use - a specific one while building, you can do so by adding the - following environment variable before building + If you have multiple Xcode installations and wish to use + a specific one while building, you can do so by adding the + following environment variable before building .. code-block:: shell export DEVELOPER_DIR="/path/to/Xcode.app/Contents/Developer/" - Further, you can use the following command to find out which + Further, you can use the following command to find out which macOS SDK will be used .. code-block:: shell @@ -201,7 +201,7 @@ Then set the active developer directory: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer -x86 Shell +x86 Shell ~~~~~~~~~ .. _build shell: diff --git a/docs/build/html/_sources/python/_autosummary/mlx.core.block_masked_mm.rst b/docs/build/html/_sources/python/_autosummary/mlx.core.block_masked_mm.rst new file mode 100644 index 000000000..6166987d9 --- /dev/null +++ b/docs/build/html/_sources/python/_autosummary/mlx.core.block_masked_mm.rst @@ -0,0 +1,6 @@ +mlx.core.block\_masked\_mm +========================== + +.. currentmodule:: mlx.core + +.. autofunction:: block_masked_mm \ No newline at end of file diff --git a/docs/build/html/_sources/python/_autosummary/mlx.core.degrees.rst b/docs/build/html/_sources/python/_autosummary/mlx.core.degrees.rst new file mode 100644 index 000000000..c9383027e --- /dev/null +++ b/docs/build/html/_sources/python/_autosummary/mlx.core.degrees.rst @@ -0,0 +1,6 @@ +mlx.core.degrees +================ + +.. currentmodule:: mlx.core + +.. autofunction:: degrees \ No newline at end of file diff --git a/docs/build/html/_sources/python/_autosummary/mlx.core.metal.clear_cache.rst b/docs/build/html/_sources/python/_autosummary/mlx.core.metal.clear_cache.rst new file mode 100644 index 000000000..092e19b2a --- /dev/null +++ b/docs/build/html/_sources/python/_autosummary/mlx.core.metal.clear_cache.rst @@ -0,0 +1,6 @@ +mlx.core.metal.clear\_cache +=========================== + +.. currentmodule:: mlx.core.metal + +.. autofunction:: clear_cache \ No newline at end of file diff --git a/docs/build/html/_sources/python/_autosummary/mlx.core.not_equal.rst b/docs/build/html/_sources/python/_autosummary/mlx.core.not_equal.rst new file mode 100644 index 000000000..8f88b8557 --- /dev/null +++ b/docs/build/html/_sources/python/_autosummary/mlx.core.not_equal.rst @@ -0,0 +1,6 @@ +mlx.core.not\_equal +=================== + +.. currentmodule:: mlx.core + +.. autofunction:: not_equal \ No newline at end of file diff --git a/docs/build/html/_sources/python/_autosummary/mlx.core.radians.rst b/docs/build/html/_sources/python/_autosummary/mlx.core.radians.rst new file mode 100644 index 000000000..0e7f27575 --- /dev/null +++ b/docs/build/html/_sources/python/_autosummary/mlx.core.radians.rst @@ -0,0 +1,6 @@ +mlx.core.radians +================ + +.. currentmodule:: mlx.core + +.. autofunction:: radians \ No newline at end of file diff --git a/docs/build/html/_sources/python/_autosummary/mlx.core.synchronize.rst b/docs/build/html/_sources/python/_autosummary/mlx.core.synchronize.rst new file mode 100644 index 000000000..7fd95af27 --- /dev/null +++ b/docs/build/html/_sources/python/_autosummary/mlx.core.synchronize.rst @@ -0,0 +1,6 @@ +mlx.core.synchronize +==================== + +.. currentmodule:: mlx.core + +.. autofunction:: synchronize \ No newline at end of file diff --git a/docs/build/html/_sources/python/_autosummary/mlx.nn.quantize.rst b/docs/build/html/_sources/python/_autosummary/mlx.nn.quantize.rst new file mode 100644 index 000000000..7f00771af --- /dev/null +++ b/docs/build/html/_sources/python/_autosummary/mlx.nn.quantize.rst @@ -0,0 +1,6 @@ +mlx.nn.quantize +=============== + +.. currentmodule:: mlx.nn + +.. autofunction:: quantize \ No newline at end of file diff --git a/docs/build/html/_sources/python/_autosummary/mlx.utils.tree_map_with_path.rst b/docs/build/html/_sources/python/_autosummary/mlx.utils.tree_map_with_path.rst new file mode 100644 index 000000000..05fcd0b8f --- /dev/null +++ b/docs/build/html/_sources/python/_autosummary/mlx.utils.tree_map_with_path.rst @@ -0,0 +1,6 @@ +mlx.utils.tree\_map\_with\_path +=============================== + +.. currentmodule:: mlx.utils + +.. autofunction:: tree_map_with_path \ No newline at end of file diff --git a/docs/build/html/_sources/python/devices_and_streams.rst b/docs/build/html/_sources/python/devices_and_streams.rst index e16ab9875..2a5adc05a 100644 --- a/docs/build/html/_sources/python/devices_and_streams.rst +++ b/docs/build/html/_sources/python/devices_and_streams.rst @@ -16,3 +16,4 @@ Devices and Streams new_stream set_default_stream stream + synchronize diff --git a/docs/build/html/_sources/python/metal.rst b/docs/build/html/_sources/python/metal.rst index c92b18936..589ec0a82 100644 --- a/docs/build/html/_sources/python/metal.rst +++ b/docs/build/html/_sources/python/metal.rst @@ -12,5 +12,6 @@ Metal get_cache_memory set_memory_limit set_cache_limit + clear_cache start_capture stop_capture diff --git a/docs/build/html/_sources/python/nn.rst b/docs/build/html/_sources/python/nn.rst index 2a253ab25..229d295cb 100644 --- a/docs/build/html/_sources/python/nn.rst +++ b/docs/build/html/_sources/python/nn.rst @@ -173,6 +173,7 @@ In detail: :toctree: _autosummary value_and_grad + quantize .. toctree:: diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.ALiBi.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.ALiBi.rst index 9159bb888..20c3d05f8 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.ALiBi.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.ALiBi.rst @@ -3,4 +3,16 @@ .. currentmodule:: mlx.nn -.. autoclass:: ALiBi \ No newline at end of file +.. autoclass:: ALiBi + + + + + .. rubric:: Methods + + .. autosummary:: + + ~ALiBi.create_alibi_matrix + ~ALiBi.create_alibi_slope + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.AvgPool1d.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.AvgPool1d.rst index 55ec40f1b..d222468eb 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.AvgPool1d.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.AvgPool1d.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: AvgPool1d \ No newline at end of file +.. autoclass:: AvgPool1d + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.AvgPool2d.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.AvgPool2d.rst index a31b6f432..859ee9547 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.AvgPool2d.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.AvgPool2d.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: AvgPool2d \ No newline at end of file +.. autoclass:: AvgPool2d + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.BatchNorm.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.BatchNorm.rst index d085d5af5..e7d02b97b 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.BatchNorm.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.BatchNorm.rst @@ -3,4 +3,15 @@ .. currentmodule:: mlx.nn -.. autoclass:: BatchNorm \ No newline at end of file +.. autoclass:: BatchNorm + + + + + .. rubric:: Methods + + .. autosummary:: + + ~BatchNorm.unfreeze + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Conv1d.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Conv1d.rst index 0fb6ff201..85ce0f3ee 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Conv1d.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Conv1d.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: Conv1d \ No newline at end of file +.. autoclass:: Conv1d + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Conv2d.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Conv2d.rst index 566e5d1e1..fafb1a14f 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Conv2d.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Conv2d.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: Conv2d \ No newline at end of file +.. autoclass:: Conv2d + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout.rst index 2ec3556e1..572c245f2 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: Dropout \ No newline at end of file +.. autoclass:: Dropout + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout2d.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout2d.rst index d643adcb9..52b06087b 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout2d.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout2d.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: Dropout2d \ No newline at end of file +.. autoclass:: Dropout2d + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout3d.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout3d.rst index f386030ee..b075c223a 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout3d.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Dropout3d.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: Dropout3d \ No newline at end of file +.. autoclass:: Dropout3d + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Embedding.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Embedding.rst index 0f29f593d..598179428 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Embedding.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Embedding.rst @@ -3,4 +3,15 @@ .. currentmodule:: mlx.nn -.. autoclass:: Embedding \ No newline at end of file +.. autoclass:: Embedding + + + + + .. rubric:: Methods + + .. autosummary:: + + ~Embedding.as_linear + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.GELU.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.GELU.rst index c6ca7a28c..ae5cfb2db 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.GELU.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.GELU.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: GELU \ No newline at end of file +.. autoclass:: GELU + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.GRU.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.GRU.rst index 568e2f6f4..134791619 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.GRU.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.GRU.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: GRU \ No newline at end of file +.. autoclass:: GRU + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.GroupNorm.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.GroupNorm.rst index 982103df5..785f96c4e 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.GroupNorm.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.GroupNorm.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: GroupNorm \ No newline at end of file +.. autoclass:: GroupNorm + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.InstanceNorm.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.InstanceNorm.rst index 66d01967f..5f84b030b 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.InstanceNorm.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.InstanceNorm.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: InstanceNorm \ No newline at end of file +.. autoclass:: InstanceNorm + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.LSTM.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.LSTM.rst index 08344b86d..dd4218f2a 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.LSTM.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.LSTM.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: LSTM \ No newline at end of file +.. autoclass:: LSTM + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.LayerNorm.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.LayerNorm.rst index 817f9551e..372561a38 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.LayerNorm.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.LayerNorm.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: LayerNorm \ No newline at end of file +.. autoclass:: LayerNorm + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Linear.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Linear.rst index 53be170e4..f19fc1994 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Linear.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Linear.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: Linear \ No newline at end of file +.. autoclass:: Linear + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.MaxPool1d.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.MaxPool1d.rst index 43ac8cada..5d0d32dae 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.MaxPool1d.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.MaxPool1d.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: MaxPool1d \ No newline at end of file +.. autoclass:: MaxPool1d + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.MaxPool2d.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.MaxPool2d.rst index ad93796f4..5ccc299b9 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.MaxPool2d.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.MaxPool2d.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: MaxPool2d \ No newline at end of file +.. autoclass:: MaxPool2d + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Mish.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Mish.rst index bd10864be..d5c61b375 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Mish.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Mish.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: Mish \ No newline at end of file +.. autoclass:: Mish + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.MultiHeadAttention.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.MultiHeadAttention.rst index 0a3f8d184..e8e53c5a9 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.MultiHeadAttention.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.MultiHeadAttention.rst @@ -3,4 +3,15 @@ .. currentmodule:: mlx.nn -.. autoclass:: MultiHeadAttention \ No newline at end of file +.. autoclass:: MultiHeadAttention + + + + + .. rubric:: Methods + + .. autosummary:: + + ~MultiHeadAttention.create_additive_causal_mask + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.PReLU.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.PReLU.rst index 4583c2d65..3d138c6ce 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.PReLU.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.PReLU.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: PReLU \ No newline at end of file +.. autoclass:: PReLU + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.QuantizedEmbedding.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.QuantizedEmbedding.rst new file mode 100644 index 000000000..981b0ac55 --- /dev/null +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.QuantizedEmbedding.rst @@ -0,0 +1,18 @@ +mlx.nn.QuantizedEmbedding +========================= + +.. currentmodule:: mlx.nn + +.. autoclass:: QuantizedEmbedding + + + + + .. rubric:: Methods + + .. autosummary:: + + ~QuantizedEmbedding.as_linear + ~QuantizedEmbedding.from_embedding + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.QuantizedLinear.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.QuantizedLinear.rst index 00688282e..d8cf393be 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.QuantizedLinear.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.QuantizedLinear.rst @@ -3,4 +3,16 @@ .. currentmodule:: mlx.nn -.. autoclass:: QuantizedLinear \ No newline at end of file +.. autoclass:: QuantizedLinear + + + + + .. rubric:: Methods + + .. autosummary:: + + ~QuantizedLinear.from_linear + ~QuantizedLinear.unfreeze + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.RMSNorm.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.RMSNorm.rst index d4501bd36..d4d2012ae 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.RMSNorm.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.RMSNorm.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: RMSNorm \ No newline at end of file +.. autoclass:: RMSNorm + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.RNN.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.RNN.rst index 6a6a1edb7..938664c99 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.RNN.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.RNN.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: RNN \ No newline at end of file +.. autoclass:: RNN + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.ReLU.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.ReLU.rst index 6707e757e..24c8175a2 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.ReLU.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.ReLU.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: ReLU \ No newline at end of file +.. autoclass:: ReLU + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.RoPE.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.RoPE.rst index fca09a4eb..de7f5ea43 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.RoPE.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.RoPE.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: RoPE \ No newline at end of file +.. autoclass:: RoPE + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.SELU.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.SELU.rst index fa7477246..c705b6cc0 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.SELU.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.SELU.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: SELU \ No newline at end of file +.. autoclass:: SELU + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Sequential.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Sequential.rst index 5ae61b025..a65107a8e 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Sequential.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Sequential.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: Sequential \ No newline at end of file +.. autoclass:: Sequential + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.SiLU.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.SiLU.rst index 57d18df4f..ad952d7df 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.SiLU.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.SiLU.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: SiLU \ No newline at end of file +.. autoclass:: SiLU + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.SinusoidalPositionalEncoding.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.SinusoidalPositionalEncoding.rst index 30b7a1f90..e26ecd835 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.SinusoidalPositionalEncoding.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.SinusoidalPositionalEncoding.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: SinusoidalPositionalEncoding \ No newline at end of file +.. autoclass:: SinusoidalPositionalEncoding + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Softshrink.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Softshrink.rst index 5e17a5199..318ce5c25 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Softshrink.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Softshrink.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: Softshrink \ No newline at end of file +.. autoclass:: Softshrink + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Step.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Step.rst index 204f8cbb1..17cb87a67 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Step.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Step.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: Step \ No newline at end of file +.. autoclass:: Step + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Transformer.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Transformer.rst index f7e800eff..017245147 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Transformer.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Transformer.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: Transformer \ No newline at end of file +.. autoclass:: Transformer + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Upsample.rst b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Upsample.rst index 6bd1855f1..ffb10275f 100644 --- a/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Upsample.rst +++ b/docs/build/html/_sources/python/nn/_autosummary/mlx.nn.Upsample.rst @@ -3,4 +3,14 @@ .. currentmodule:: mlx.nn -.. autoclass:: Upsample \ No newline at end of file +.. autoclass:: Upsample + + + + + .. rubric:: Methods + + .. autosummary:: + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.elu.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.elu.rst index 7fceaa9dc..984a258f6 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.elu.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.elu.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: elu \ No newline at end of file +.. autoclass:: elu + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.gelu.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.gelu.rst index 616cb1e22..09f96fd7c 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.gelu.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.gelu.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: gelu \ No newline at end of file +.. autoclass:: gelu + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.gelu_approx.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.gelu_approx.rst index d634ee1de..0ba8bd9f6 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.gelu_approx.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.gelu_approx.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: gelu_approx \ No newline at end of file +.. autoclass:: gelu_approx + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.gelu_fast_approx.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.gelu_fast_approx.rst index 36cc04480..5f98efb34 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.gelu_fast_approx.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.gelu_fast_approx.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: gelu_fast_approx \ No newline at end of file +.. autoclass:: gelu_fast_approx + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.glu.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.glu.rst index f289859db..8fa91f0b5 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.glu.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.glu.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: glu \ No newline at end of file +.. autoclass:: glu + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.hardswish.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.hardswish.rst index c824569e7..d8ebf4348 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.hardswish.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.hardswish.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: hardswish \ No newline at end of file +.. autoclass:: hardswish + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.leaky_relu.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.leaky_relu.rst index 18f8fdd49..53470fa16 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.leaky_relu.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.leaky_relu.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: leaky_relu \ No newline at end of file +.. autoclass:: leaky_relu + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.log_sigmoid.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.log_sigmoid.rst index 662a3a1fb..a9b125b06 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.log_sigmoid.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.log_sigmoid.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: log_sigmoid \ No newline at end of file +.. autoclass:: log_sigmoid + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.log_softmax.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.log_softmax.rst index 114bc726b..03467aa91 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.log_softmax.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.log_softmax.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: log_softmax \ No newline at end of file +.. autoclass:: log_softmax + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.binary_cross_entropy.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.binary_cross_entropy.rst index ba5254eff..6e56d4294 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.binary_cross_entropy.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.binary_cross_entropy.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn.losses -.. autofunction:: binary_cross_entropy \ No newline at end of file +.. autoclass:: binary_cross_entropy + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.cosine_similarity_loss.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.cosine_similarity_loss.rst index 27b5d4a8e..33b9f4383 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.cosine_similarity_loss.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.cosine_similarity_loss.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn.losses -.. autofunction:: cosine_similarity_loss \ No newline at end of file +.. autoclass:: cosine_similarity_loss + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.cross_entropy.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.cross_entropy.rst index fd7f9e6f6..942744c67 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.cross_entropy.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.cross_entropy.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn.losses -.. autofunction:: cross_entropy \ No newline at end of file +.. autoclass:: cross_entropy + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.gaussian_nll_loss.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.gaussian_nll_loss.rst index a481e2317..50ae9d724 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.gaussian_nll_loss.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.gaussian_nll_loss.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn.losses -.. autofunction:: gaussian_nll_loss \ No newline at end of file +.. autoclass:: gaussian_nll_loss + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.hinge_loss.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.hinge_loss.rst index 092dcd383..9cf2fcea1 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.hinge_loss.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.hinge_loss.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn.losses -.. autofunction:: hinge_loss \ No newline at end of file +.. autoclass:: hinge_loss + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.huber_loss.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.huber_loss.rst index da5e4d417..a706dd4b3 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.huber_loss.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.huber_loss.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn.losses -.. autofunction:: huber_loss \ No newline at end of file +.. autoclass:: huber_loss + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.kl_div_loss.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.kl_div_loss.rst index 04d2fcce3..c3f1c3ff7 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.kl_div_loss.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.kl_div_loss.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn.losses -.. autofunction:: kl_div_loss \ No newline at end of file +.. autoclass:: kl_div_loss + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.l1_loss.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.l1_loss.rst index 950aff725..c126f7912 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.l1_loss.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.l1_loss.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn.losses -.. autofunction:: l1_loss \ No newline at end of file +.. autoclass:: l1_loss + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.log_cosh_loss.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.log_cosh_loss.rst index b7a7461c9..fa3737e61 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.log_cosh_loss.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.log_cosh_loss.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn.losses -.. autofunction:: log_cosh_loss \ No newline at end of file +.. autoclass:: log_cosh_loss + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.margin_ranking_loss.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.margin_ranking_loss.rst index ede1b9f0a..ab9d6e73f 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.margin_ranking_loss.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.margin_ranking_loss.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn.losses -.. autofunction:: margin_ranking_loss \ No newline at end of file +.. autoclass:: margin_ranking_loss + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.mse_loss.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.mse_loss.rst index c4e44ddb1..6af11d8d2 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.mse_loss.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.mse_loss.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn.losses -.. autofunction:: mse_loss \ No newline at end of file +.. autoclass:: mse_loss + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.nll_loss.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.nll_loss.rst index e64b55dfc..25141d96e 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.nll_loss.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.nll_loss.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn.losses -.. autofunction:: nll_loss \ No newline at end of file +.. autoclass:: nll_loss + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.smooth_l1_loss.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.smooth_l1_loss.rst index d96bb5823..208b5419a 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.smooth_l1_loss.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.smooth_l1_loss.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn.losses -.. autofunction:: smooth_l1_loss \ No newline at end of file +.. autoclass:: smooth_l1_loss + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.triplet_loss.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.triplet_loss.rst index f52eaab92..abf62044f 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.triplet_loss.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.losses.triplet_loss.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn.losses -.. autofunction:: triplet_loss \ No newline at end of file +.. autoclass:: triplet_loss + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.mish.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.mish.rst index 49c1cfcb9..c2afa612c 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.mish.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.mish.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: mish \ No newline at end of file +.. autoclass:: mish + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.prelu.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.prelu.rst index 51085ec23..41f6160a7 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.prelu.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.prelu.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: prelu \ No newline at end of file +.. autoclass:: prelu + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.relu.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.relu.rst index f1c28d7aa..02f143aea 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.relu.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.relu.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: relu \ No newline at end of file +.. autoclass:: relu + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.relu6.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.relu6.rst index ce7dbb95a..8ec684898 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.relu6.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.relu6.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: relu6 \ No newline at end of file +.. autoclass:: relu6 + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.selu.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.selu.rst index f1530a805..1beb9d4e7 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.selu.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.selu.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: selu \ No newline at end of file +.. autoclass:: selu + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.sigmoid.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.sigmoid.rst index 26e91621e..2f1932d36 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.sigmoid.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.sigmoid.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: sigmoid \ No newline at end of file +.. autoclass:: sigmoid + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.silu.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.silu.rst index cd5ff218e..3df111302 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.silu.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.silu.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: silu \ No newline at end of file +.. autoclass:: silu + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.softmax.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.softmax.rst index 6111f8079..a3278b877 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.softmax.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.softmax.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: softmax \ No newline at end of file +.. autoclass:: softmax + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.softplus.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.softplus.rst index b029eed48..6b129a2dc 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.softplus.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.softplus.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: softplus \ No newline at end of file +.. autoclass:: softplus + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.softshrink.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.softshrink.rst index b844f9242..882c2536d 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.softshrink.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.softshrink.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: softshrink \ No newline at end of file +.. autoclass:: softshrink + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.step.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.step.rst index 0ad2c19e6..c4413efc7 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.step.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.step.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: step \ No newline at end of file +.. autoclass:: step + + + + + diff --git a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.tanh.rst b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.tanh.rst index 45b6f4ac6..030228173 100644 --- a/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.tanh.rst +++ b/docs/build/html/_sources/python/nn/_autosummary_functions/mlx.nn.tanh.rst @@ -3,4 +3,9 @@ .. currentmodule:: mlx.nn -.. autofunction:: tanh \ No newline at end of file +.. autoclass:: tanh + + + + + diff --git a/docs/build/html/_sources/python/nn/layers.rst b/docs/build/html/_sources/python/nn/layers.rst index c0b59b6d4..6fb624d54 100644 --- a/docs/build/html/_sources/python/nn/layers.rst +++ b/docs/build/html/_sources/python/nn/layers.rst @@ -31,6 +31,7 @@ Layers Mish MultiHeadAttention PReLU + QuantizedEmbedding QuantizedLinear RMSNorm ReLU @@ -43,4 +44,4 @@ Layers Softshrink Step Transformer - Upsample \ No newline at end of file + Upsample diff --git a/docs/build/html/_sources/python/ops.rst b/docs/build/html/_sources/python/ops.rst index 1e934befd..7795512a0 100644 --- a/docs/build/html/_sources/python/ops.rst +++ b/docs/build/html/_sources/python/ops.rst @@ -29,6 +29,7 @@ Operations atleast_2d atleast_3d broadcast_to + block_masked_mm ceil clip concatenate @@ -42,6 +43,7 @@ Operations cummin cumprod cumsum + degrees dequantize diag diagonal @@ -90,6 +92,7 @@ Operations moveaxis multiply negative + not_equal ones ones_like outer @@ -98,6 +101,7 @@ Operations prod quantize quantized_matmul + radians reciprocal repeat reshape diff --git a/docs/build/html/_sources/python/tree_utils.rst b/docs/build/html/_sources/python/tree_utils.rst index 84d5afa9b..dbd0ebce9 100644 --- a/docs/build/html/_sources/python/tree_utils.rst +++ b/docs/build/html/_sources/python/tree_utils.rst @@ -19,3 +19,4 @@ return python trees will be using the default python ``dict``, ``list`` and tree_flatten tree_unflatten tree_map + tree_map_with_path diff --git a/docs/build/html/_static/_sphinx_javascript_frameworks_compat.js b/docs/build/html/_static/_sphinx_javascript_frameworks_compat.js deleted file mode 100644 index 8549469dc..000000000 --- a/docs/build/html/_static/_sphinx_javascript_frameworks_compat.js +++ /dev/null @@ -1,134 +0,0 @@ -/* - * _sphinx_javascript_frameworks_compat.js - * ~~~~~~~~~~ - * - * Compatability shim for jQuery and underscores.js. - * - * WILL BE REMOVED IN Sphinx 6.0 - * xref RemovedInSphinx60Warning - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - - -/** - * small helper function to urldecode strings - * - * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL - */ -jQuery.urldecode = function(x) { - if (!x) { - return x - } - return decodeURIComponent(x.replace(/\+/g, ' ')); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s === 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node, addItems) { - if (node.nodeType === 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && - !jQuery(node.parentNode).hasClass(className) && - !jQuery(node.parentNode).hasClass("nohighlight")) { - var span; - var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); - if (isInSVG) { - span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); - } else { - span = document.createElement("span"); - span.className = className; - } - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - if (isInSVG) { - var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); - var bbox = node.parentElement.getBBox(); - rect.x.baseVal.value = bbox.x; - rect.y.baseVal.value = bbox.y; - rect.width.baseVal.value = bbox.width; - rect.height.baseVal.value = bbox.height; - rect.setAttribute('class', className); - addItems.push({ - "parent": node.parentNode, - "target": rect}); - } - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this, addItems); - }); - } - } - var addItems = []; - var result = this.each(function() { - highlight(this, addItems); - }); - for (var i = 0; i < addItems.length; ++i) { - jQuery(addItems[i].parent).before(addItems[i].target); - } - return result; -}; - -/* - * backward compatibility for jQuery.browser - * This will be supported until firefox bug is fixed. - */ -if (!jQuery.browser) { - jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(webkit)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - jQuery.browser = {}; - jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; -} diff --git a/docs/build/html/_static/documentation_options.js b/docs/build/html/_static/documentation_options.js index 0e02a9a5b..b217302fd 100644 --- a/docs/build/html/_static/documentation_options.js +++ b/docs/build/html/_static/documentation_options.js @@ -1,5 +1,5 @@ const DOCUMENTATION_OPTIONS = { - VERSION: '0.10.0', + VERSION: '0.12.0', LANGUAGE: 'en', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/docs/build/html/_static/jquery-3.6.0.js b/docs/build/html/_static/jquery-3.6.0.js deleted file mode 100644 index fc6c299b7..000000000 --- a/docs/build/html/_static/jquery-3.6.0.js +++ /dev/null @@ -1,10881 +0,0 @@ -/*! - * jQuery JavaScript Library v3.6.0 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright OpenJS Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2021-03-02T17:08Z - */ -( function( global, factory ) { - - "use strict"; - - if ( typeof module === "object" && typeof module.exports === "object" ) { - - // For CommonJS and CommonJS-like environments where a proper `window` - // is present, execute the factory and get jQuery. - // For environments that do not have a `window` with a `document` - // (such as Node.js), expose a factory as module.exports. - // This accentuates the need for the creation of a real `window`. - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info. - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 -// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode -// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common -// enough that all such attempts are guarded in a try block. -"use strict"; - -var arr = []; - -var getProto = Object.getPrototypeOf; - -var slice = arr.slice; - -var flat = arr.flat ? function( array ) { - return arr.flat.call( array ); -} : function( array ) { - return arr.concat.apply( [], array ); -}; - - -var push = arr.push; - -var indexOf = arr.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var fnToString = hasOwn.toString; - -var ObjectFunctionString = fnToString.call( Object ); - -var support = {}; - -var isFunction = function isFunction( obj ) { - - // Support: Chrome <=57, Firefox <=52 - // In some browsers, typeof returns "function" for HTML elements - // (i.e., `typeof document.createElement( "object" ) === "function"`). - // We don't want to classify *any* DOM node as a function. - // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 - // Plus for old WebKit, typeof returns "function" for HTML collections - // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) - return typeof obj === "function" && typeof obj.nodeType !== "number" && - typeof obj.item !== "function"; - }; - - -var isWindow = function isWindow( obj ) { - return obj != null && obj === obj.window; - }; - - -var document = window.document; - - - - var preservedScriptAttributes = { - type: true, - src: true, - nonce: true, - noModule: true - }; - - function DOMEval( code, node, doc ) { - doc = doc || document; - - var i, val, - script = doc.createElement( "script" ); - - script.text = code; - if ( node ) { - for ( i in preservedScriptAttributes ) { - - // Support: Firefox 64+, Edge 18+ - // Some browsers don't support the "nonce" property on scripts. - // On the other hand, just using `getAttribute` is not enough as - // the `nonce` attribute is reset to an empty string whenever it - // becomes browsing-context connected. - // See https://github.com/whatwg/html/issues/2369 - // See https://html.spec.whatwg.org/#nonce-attributes - // The `node.getAttribute` check was added for the sake of - // `jQuery.globalEval` so that it can fake a nonce-containing node - // via an object. - val = node[ i ] || node.getAttribute && node.getAttribute( i ); - if ( val ) { - script.setAttribute( i, val ); - } - } - } - doc.head.appendChild( script ).parentNode.removeChild( script ); - } - - -function toType( obj ) { - if ( obj == null ) { - return obj + ""; - } - - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; -} -/* global Symbol */ -// Defining this global in .eslintrc.json would create a danger of using the global -// unguarded in another place, it seems safer to define global only for this module - - - -var - version = "3.6.0", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }; - -jQuery.fn = jQuery.prototype = { - - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - - // Return all the elements in a clean array - if ( num == null ) { - return slice.call( this ); - } - - // Return just the one element from the set - return num < 0 ? this[ num + this.length ] : this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - each: function( callback ) { - return jQuery.each( this, callback ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map( this, function( elem, i ) { - return callback.call( elem, i, elem ); - } ) ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - even: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return ( i + 1 ) % 2; - } ) ); - }, - - odd: function() { - return this.pushStack( jQuery.grep( this, function( _elem, i ) { - return i % 2; - } ) ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // Skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !isFunction( target ) ) { - target = {}; - } - - // Extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - - // Only deal with non-null/undefined values - if ( ( options = arguments[ i ] ) != null ) { - - // Extend the base object - for ( name in options ) { - copy = options[ name ]; - - // Prevent Object.prototype pollution - // Prevent never-ending loop - if ( name === "__proto__" || target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = Array.isArray( copy ) ) ) ) { - src = target[ name ]; - - // Ensure proper type for the source value - if ( copyIsArray && !Array.isArray( src ) ) { - clone = []; - } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { - clone = {}; - } else { - clone = src; - } - copyIsArray = false; - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend( { - - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - isPlainObject: function( obj ) { - var proto, Ctor; - - // Detect obvious negatives - // Use toString instead of jQuery.type to catch host objects - if ( !obj || toString.call( obj ) !== "[object Object]" ) { - return false; - } - - proto = getProto( obj ); - - // Objects with no prototype (e.g., `Object.create( null )`) are plain - if ( !proto ) { - return true; - } - - // Objects with prototype are plain iff they were constructed by a global Object function - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; - }, - - isEmptyObject: function( obj ) { - var name; - - for ( name in obj ) { - return false; - } - return true; - }, - - // Evaluates a script in a provided context; falls back to the global one - // if not specified. - globalEval: function( code, options, doc ) { - DOMEval( code, { nonce: options && options.nonce }, doc ); - }, - - each: function( obj, callback ) { - var length, i = 0; - - if ( isArrayLike( obj ) ) { - length = obj.length; - for ( ; i < length; i++ ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } else { - for ( i in obj ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } - - return obj; - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArrayLike( Object( arr ) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var length, value, - i = 0, - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArrayLike( elems ) ) { - length = elems.length; - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return flat( ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -} ); - -if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; -} - -// Populate the class2type map -jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), - function( _i, name ) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); - } ); - -function isArrayLike( obj ) { - - // Support: real iOS 8.2 only (not reproducible in simulator) - // `in` check used to prevent JIT error (gh-2145) - // hasOwn isn't used here due to false negatives - // regarding Nodelist length in IE - var length = !!obj && "length" in obj && obj.length, - type = toType( obj ); - - if ( isFunction( obj ) || isWindow( obj ) ) { - return false; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v2.3.6 - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://js.foundation/ - * - * Date: 2021-02-16 - */ -( function( window ) { -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - nonnativeSelectorCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // Instance methods - hasOwn = ( {} ).hasOwnProperty, - arr = [], - pop = arr.pop, - pushNative = arr.push, - push = arr.push, - slice = arr.slice, - - // Use a stripped-down indexOf as it's faster than native - // https://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { - var i = 0, - len = list.length; - for ( ; i < len; i++ ) { - if ( list[ i ] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + - "ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - - // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram - identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + - "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - - // "Attribute values must be CSS identifiers [capture 5] - // or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + - whitespace + "*\\]", - - pseudos = ":(" + identifier + ")(?:\\((" + - - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + - whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + - "*" ), - rdescend = new RegExp( whitespace + "|>" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + identifier + ")" ), - "CLASS": new RegExp( "^\\.(" + identifier + ")" ), - "TAG": new RegExp( "^(" + identifier + "|[*])" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + - whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + - whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + - "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + - "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rhtml = /HTML$/i, - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - - // CSS escapes - // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), - funescape = function( escape, nonHex ) { - var high = "0x" + escape.slice( 1 ) - 0x10000; - - return nonHex ? - - // Strip the backslash prefix from a non-hex escape sequence - nonHex : - - // Replace a hexadecimal escape sequence with the encoded Unicode code point - // Support: IE <=11+ - // For values outside the Basic Multilingual Plane (BMP), manually construct a - // surrogate pair - high < 0 ? - String.fromCharCode( high + 0x10000 ) : - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }, - - // CSS string/identifier serialization - // https://drafts.csswg.org/cssom/#common-serializing-idioms - rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, - fcssescape = function( ch, asCodePoint ) { - if ( asCodePoint ) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if ( ch === "\0" ) { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + - ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; - } - - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }, - - inDisabledFieldset = addCombinator( - function( elem ) { - return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; - }, - { dir: "parentNode", next: "legend" } - ); - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - ( arr = slice.call( preferredDoc.childNodes ) ), - preferredDoc.childNodes - ); - - // Support: Android<4.0 - // Detect silently failing push.apply - // eslint-disable-next-line no-unused-expressions - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - pushNative.apply( target, slice.call( els ) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - - // Can't trust NodeList.length - while ( ( target[ j++ ] = els[ i++ ] ) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var m, i, elem, nid, match, groups, newSelector, - newContext = context && context.ownerDocument, - - // nodeType defaults to 9, since context defaults to document - nodeType = context ? context.nodeType : 9; - - results = results || []; - - // Return early from calls with invalid selector or context - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - // Try to shortcut find operations (as opposed to filters) in HTML documents - if ( !seed ) { - setDocument( context ); - context = context || document; - - if ( documentIsHTML ) { - - // If the selector is sufficiently simple, try using a "get*By*" DOM method - // (excepting DocumentFragment context, where the methods don't exist) - if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { - - // ID selector - if ( ( m = match[ 1 ] ) ) { - - // Document context - if ( nodeType === 9 ) { - if ( ( elem = context.getElementById( m ) ) ) { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - - // Element context - } else { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( newContext && ( elem = newContext.getElementById( m ) ) && - contains( context, elem ) && - elem.id === m ) { - - results.push( elem ); - return results; - } - } - - // Type selector - } else if ( match[ 2 ] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Class selector - } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && - context.getElementsByClassName ) { - - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // Take advantage of querySelectorAll - if ( support.qsa && - !nonnativeSelectorCache[ selector + " " ] && - ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && - - // Support: IE 8 only - // Exclude object elements - ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { - - newSelector = selector; - newContext = context; - - // qSA considers elements outside a scoping root when evaluating child or - // descendant combinators, which is not what we want. - // In such cases, we work around the behavior by prefixing every selector in the - // list with an ID selector referencing the scope context. - // The technique has to be used as well when a leading combinator is used - // as such selectors are not recognized by querySelectorAll. - // Thanks to Andrew Dupont for this technique. - if ( nodeType === 1 && - ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - - // We can use :scope instead of the ID hack if the browser - // supports it & if we're not changing the context. - if ( newContext !== context || !support.scope ) { - - // Capture the context ID, setting it first if necessary - if ( ( nid = context.getAttribute( "id" ) ) ) { - nid = nid.replace( rcssescape, fcssescape ); - } else { - context.setAttribute( "id", ( nid = expando ) ); - } - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - while ( i-- ) { - groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + - toSelector( groups[ i ] ); - } - newSelector = groups.join( "," ); - } - - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - nonnativeSelectorCache( selector, true ); - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {function(string, object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return ( cache[ key + " " ] = value ); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created element and returns a boolean result - */ -function assert( fn ) { - var el = document.createElement( "fieldset" ); - - try { - return !!fn( el ); - } catch ( e ) { - return false; - } finally { - - // Remove from its parent by default - if ( el.parentNode ) { - el.parentNode.removeChild( el ); - } - - // release memory in IE - el = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split( "|" ), - i = arr.length; - - while ( i-- ) { - Expr.attrHandle[ arr[ i ] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - a.sourceIndex - b.sourceIndex; - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( ( cur = cur.nextSibling ) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return ( name === "input" || name === "button" ) && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for :enabled/:disabled - * @param {Boolean} disabled true for :disabled; false for :enabled - */ -function createDisabledPseudo( disabled ) { - - // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable - return function( elem ) { - - // Only certain elements can match :enabled or :disabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled - if ( "form" in elem ) { - - // Check for inherited disabledness on relevant non-disabled elements: - // * listed form-associated elements in a disabled fieldset - // https://html.spec.whatwg.org/multipage/forms.html#category-listed - // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled - // * option elements in a disabled optgroup - // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled - // All such elements have a "form" property. - if ( elem.parentNode && elem.disabled === false ) { - - // Option elements defer to a parent optgroup if present - if ( "label" in elem ) { - if ( "label" in elem.parentNode ) { - return elem.parentNode.disabled === disabled; - } else { - return elem.disabled === disabled; - } - } - - // Support: IE 6 - 11 - // Use the isDisabled shortcut property to check for disabled fieldset ancestors - return elem.isDisabled === disabled || - - // Where there is no isDisabled, check manually - /* jshint -W018 */ - elem.isDisabled !== !disabled && - inDisabledFieldset( elem ) === disabled; - } - - return elem.disabled === disabled; - - // Try to winnow out elements that can't be disabled before trusting the disabled property. - // Some victims get caught in our net (label, legend, menu, track), but it shouldn't - // even exist on them, let alone have a boolean value. - } else if ( "label" in elem ) { - return elem.disabled === disabled; - } - - // Remaining elements are neither :enabled nor :disabled - return false; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction( function( argument ) { - argument = +argument; - return markFunction( function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ ( j = matchIndexes[ i ] ) ] ) { - seed[ j ] = !( matches[ j ] = seed[ j ] ); - } - } - } ); - } ); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== "undefined" && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - var namespace = elem && elem.namespaceURI, - docElem = elem && ( elem.ownerDocument || elem ).documentElement; - - // Support: IE <=8 - // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes - // https://bugs.jquery.com/ticket/4833 - return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, subWindow, - doc = node ? node.ownerDocument || node : preferredDoc; - - // Return early if doc is invalid or already selected - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Update global variables - document = doc; - docElem = document.documentElement; - documentIsHTML = !isXML( document ); - - // Support: IE 9 - 11+, Edge 12 - 18+ - // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( preferredDoc != document && - ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { - - // Support: IE 11, Edge - if ( subWindow.addEventListener ) { - subWindow.addEventListener( "unload", unloadHandler, false ); - - // Support: IE 9 - 10 only - } else if ( subWindow.attachEvent ) { - subWindow.attachEvent( "onunload", unloadHandler ); - } - } - - // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, - // Safari 4 - 5 only, Opera <=11.6 - 12.x only - // IE/Edge & older browsers don't support the :scope pseudo-class. - // Support: Safari 6.0 only - // Safari 6.0 supports :scope but it's an alias of :root there. - support.scope = assert( function( el ) { - docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); - return typeof el.querySelectorAll !== "undefined" && - !el.querySelectorAll( ":scope fieldset div" ).length; - } ); - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties - // (excepting IE8 booleans) - support.attributes = assert( function( el ) { - el.className = "i"; - return !el.getAttribute( "className" ); - } ); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert( function( el ) { - el.appendChild( document.createComment( "" ) ); - return !el.getElementsByTagName( "*" ).length; - } ); - - // Support: IE<9 - support.getElementsByClassName = rnative.test( document.getElementsByClassName ); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programmatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert( function( el ) { - docElem.appendChild( el ).id = expando; - return !document.getElementsByName || !document.getElementsByName( expando ).length; - } ); - - // ID filter and find - if ( support.getById ) { - Expr.filter[ "ID" ] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute( "id" ) === attrId; - }; - }; - Expr.find[ "ID" ] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var elem = context.getElementById( id ); - return elem ? [ elem ] : []; - } - }; - } else { - Expr.filter[ "ID" ] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && - elem.getAttributeNode( "id" ); - return node && node.value === attrId; - }; - }; - - // Support: IE 6 - 7 only - // getElementById is not reliable as a find shortcut - Expr.find[ "ID" ] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var node, i, elems, - elem = context.getElementById( id ); - - if ( elem ) { - - // Verify the id attribute - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - - // Fall back on getElementsByName - elems = context.getElementsByName( id ); - i = 0; - while ( ( elem = elems[ i++ ] ) ) { - node = elem.getAttributeNode( "id" ); - if ( node && node.value === id ) { - return [ elem ]; - } - } - } - - return []; - } - }; - } - - // Tag - Expr.find[ "TAG" ] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( tag ); - - // DocumentFragment nodes don't have gEBTN - } else if ( support.qsa ) { - return context.querySelectorAll( tag ); - } - } : - - function( tag, context ) { - var elem, - tmp = [], - i = 0, - - // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See https://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { - - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert( function( el ) { - - var input; - - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // https://bugs.jquery.com/ticket/12359 - docElem.appendChild( el ).innerHTML = "" + - ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !el.querySelectorAll( "[selected]" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ - if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push( "~=" ); - } - - // Support: IE 11+, Edge 15 - 18+ - // IE 11/Edge don't find elements on a `[name='']` query in some cases. - // Adding a temporary attribute to the document before the selection works - // around the issue. - // Interestingly, IE 10 & older don't seem to have the issue. - input = document.createElement( "input" ); - input.setAttribute( "name", "" ); - el.appendChild( input ); - if ( !el.querySelectorAll( "[name='']" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + - whitespace + "*(?:''|\"\")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !el.querySelectorAll( ":checked" ).length ) { - rbuggyQSA.push( ":checked" ); - } - - // Support: Safari 8+, iOS 8+ - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibling-combinator selector` fails - if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push( ".#.+[+~]" ); - } - - // Support: Firefox <=3.6 - 5 only - // Old Firefox doesn't throw on a badly-escaped identifier. - el.querySelectorAll( "\\\f" ); - rbuggyQSA.push( "[\\r\\n\\f]" ); - } ); - - assert( function( el ) { - el.innerHTML = "" + - ""; - - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = document.createElement( "input" ); - input.setAttribute( "type", "hidden" ); - el.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( el.querySelectorAll( "[name=d]" ).length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: IE9-11+ - // IE's :disabled selector does not pick up the children of disabled fieldsets - docElem.appendChild( el ).disabled = true; - if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: Opera 10 - 11 only - // Opera 10-11 does not throw on post-comma invalid pseudos - el.querySelectorAll( "*,:x" ); - rbuggyQSA.push( ",.*:" ); - } ); - } - - if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector ) ) ) ) { - - assert( function( el ) { - - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( el, "*" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( el, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - } ); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully self-exclusive - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - ) ); - } : - function( a, b ) { - if ( b ) { - while ( ( b = b.parentNode ) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { - - // Choose the first element that is related to our preferred document - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( a == document || a.ownerDocument == preferredDoc && - contains( preferredDoc, a ) ) { - return -1; - } - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( b == document || b.ownerDocument == preferredDoc && - contains( preferredDoc, b ) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - /* eslint-disable eqeqeq */ - return a == document ? -1 : - b == document ? 1 : - /* eslint-enable eqeqeq */ - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( ( cur = cur.parentNode ) ) { - ap.unshift( cur ); - } - cur = b; - while ( ( cur = cur.parentNode ) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[ i ] === bp[ i ] ) { - i++; - } - - return i ? - - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[ i ], bp[ i ] ) : - - // Otherwise nodes in our document sort first - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - /* eslint-disable eqeqeq */ - ap[ i ] == preferredDoc ? -1 : - bp[ i ] == preferredDoc ? 1 : - /* eslint-enable eqeqeq */ - 0; - }; - - return document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - setDocument( elem ); - - if ( support.matchesSelector && documentIsHTML && - !nonnativeSelectorCache[ expr + " " ] && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch ( e ) { - nonnativeSelectorCache( expr, true ); - } - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( context.ownerDocument || context ) != document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - - // Set document vars if needed - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( ( elem.ownerDocument || elem ) != document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - ( val = elem.getAttributeNode( name ) ) && val.specified ? - val.value : - null; -}; - -Sizzle.escape = function( sel ) { - return ( sel + "" ).replace( rcssescape, fcssescape ); -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( ( elem = results[ i++ ] ) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - - // If no nodeType, this is expected to be an array - while ( ( node = elem[ i++ ] ) ) { - - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[ 1 ] = match[ 1 ].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[ 3 ] = ( match[ 3 ] || match[ 4 ] || - match[ 5 ] || "" ).replace( runescape, funescape ); - - if ( match[ 2 ] === "~=" ) { - match[ 3 ] = " " + match[ 3 ] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[ 1 ] = match[ 1 ].toLowerCase(); - - if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { - - // nth-* requires argument - if ( !match[ 3 ] ) { - Sizzle.error( match[ 0 ] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[ 4 ] = +( match[ 4 ] ? - match[ 5 ] + ( match[ 6 ] || 1 ) : - 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); - match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); - - // other types prohibit arguments - } else if ( match[ 3 ] ) { - Sizzle.error( match[ 0 ] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[ 6 ] && match[ 2 ]; - - if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[ 3 ] ) { - match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - - // Get excess from tokenize (recursively) - ( excess = tokenize( unquoted, true ) ) && - - // advance to the next closing parenthesis - ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { - - // excess is a negative index - match[ 0 ] = match[ 0 ].slice( 0, excess ); - match[ 2 ] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { - return true; - } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - ( pattern = new RegExp( "(^|" + whitespace + - ")" + className + "(" + whitespace + "|$)" ) ) && classCache( - className, function( elem ) { - return pattern.test( - typeof elem.className === "string" && elem.className || - typeof elem.getAttribute !== "undefined" && - elem.getAttribute( "class" ) || - "" - ); - } ); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - /* eslint-disable max-len */ - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - /* eslint-enable max-len */ - - }; - }, - - "CHILD": function( type, what, _argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, _context, xml ) { - var cache, uniqueCache, outerCache, node, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType, - diff = false; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( ( node = node[ dir ] ) ) { - if ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) { - - return false; - } - } - - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - - // Seek `elem` from a previously-cached index - - // ...in a gzip-friendly way - node = parent; - outerCache = node[ expando ] || ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex && cache[ 2 ]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( ( node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - } else { - - // Use previously-cached element index if available - if ( useCache ) { - - // ...in a gzip-friendly way - node = elem; - outerCache = node[ expando ] || ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex; - } - - // xml :nth-child(...) - // or :nth-last-child(...) or :nth(-last)?-of-type(...) - if ( diff === false ) { - - // Use the same loop as above to seek `elem` from the start - while ( ( node = ++nodeIndex && node && node[ dir ] || - ( diff = nodeIndex = 0 ) || start.pop() ) ) { - - if ( ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) && - ++diff ) { - - // Cache the index of each encountered element - if ( useCache ) { - outerCache = node[ expando ] || - ( node[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - ( outerCache[ node.uniqueID ] = {} ); - - uniqueCache[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction( function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf( seed, matched[ i ] ); - seed[ idx ] = !( matches[ idx ] = matched[ i ] ); - } - } ) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - - // Potentially complex pseudos - "not": markFunction( function( selector ) { - - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction( function( seed, matches, _context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( ( elem = unmatched[ i ] ) ) { - seed[ i ] = !( matches[ i ] = elem ); - } - } - } ) : - function( elem, _context, xml ) { - input[ 0 ] = elem; - matcher( input, null, xml, results ); - - // Don't keep the element (issue #299) - input[ 0 ] = null; - return !results.pop(); - }; - } ), - - "has": markFunction( function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - } ), - - "contains": markFunction( function( text ) { - text = text.replace( runescape, funescape ); - return function( elem ) { - return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; - }; - } ), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - - // lang value must be a valid identifier - if ( !ridentifier.test( lang || "" ) ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( ( elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); - return false; - }; - } ), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && - ( !document.hasFocus || document.hasFocus() ) && - !!( elem.type || elem.href || ~elem.tabIndex ); - }, - - // Boolean properties - "enabled": createDisabledPseudo( false ), - "disabled": createDisabledPseudo( true ), - - "checked": function( elem ) { - - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return ( nodeName === "input" && !!elem.checked ) || - ( nodeName === "option" && !!elem.selected ); - }, - - "selected": function( elem ) { - - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - // eslint-disable-next-line no-unused-expressions - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos[ "empty" ]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( ( attr = elem.getAttribute( "type" ) ) == null || - attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo( function() { - return [ 0 ]; - } ), - - "last": createPositionalPseudo( function( _matchIndexes, length ) { - return [ length - 1 ]; - } ), - - "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - } ), - - "even": createPositionalPseudo( function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "odd": createPositionalPseudo( function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? - argument + length : - argument > length ? - length : - argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ), - - "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - } ) - } -}; - -Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || ( match = rcomma.exec( soFar ) ) ) { - if ( match ) { - - // Don't consume trailing commas as valid - soFar = soFar.slice( match[ 0 ].length ) || soFar; - } - groups.push( ( tokens = [] ) ); - } - - matched = false; - - // Combinators - if ( ( match = rcombinators.exec( soFar ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - - // Cast descendant combinators to space - type: match[ 0 ].replace( rtrim, " " ) - } ); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || - ( match = preFilters[ type ]( match ) ) ) ) { - matched = match.shift(); - tokens.push( { - value: matched, - type: type, - matches: match - } ); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[ i ].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - skip = combinator.next, - key = skip || dir, - checkNonElements = base && key === "parentNode", - doneName = done++; - - return combinator.first ? - - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - return false; - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, uniqueCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching - if ( xml ) { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( ( elem = elem[ dir ] ) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || ( elem[ expando ] = {} ); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ elem.uniqueID ] || - ( outerCache[ elem.uniqueID ] = {} ); - - if ( skip && skip === elem.nodeName.toLowerCase() ) { - elem = elem[ dir ] || elem; - } else if ( ( oldCache = uniqueCache[ key ] ) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return ( newCache[ 2 ] = oldCache[ 2 ] ); - } else { - - // Reuse newcache so results back-propagate to previous elements - uniqueCache[ key ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { - return true; - } - } - } - } - } - return false; - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[ i ]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[ 0 ]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[ i ], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( ( elem = unmatched[ i ] ) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction( function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( - selector || "*", - context.nodeType ? [ context ] : context, - [] - ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( ( elem = temp[ i ] ) ) { - matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) ) { - - // Restore matcherIn since elem is not yet a final match - temp.push( ( matcherIn[ i ] = elem ) ); - } - } - postFinder( null, ( matcherOut = [] ), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( ( elem = matcherOut[ i ] ) && - ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { - - seed[ temp ] = !( results[ temp ] = elem ); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - } ); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[ 0 ].type ], - implicitRelative = leadingRelative || Expr.relative[ " " ], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - ( checkContext = context ).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - - // Avoid hanging onto element (issue #299) - checkContext = null; - return ret; - } ]; - - for ( ; i < len; i++ ) { - if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { - matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; - } else { - matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[ j ].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens - .slice( 0, i - 1 ) - .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), - - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), - len = elems.length; - - if ( outermost ) { - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - outermostContext = context == document || context || outermost; - } - - // Add elements passing elementMatchers directly to results - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - - // Support: IE 11+, Edge 17 - 18+ - // IE/Edge sometimes throw a "Permission denied" error when strict-comparing - // two documents; shallow comparisons work. - // eslint-disable-next-line eqeqeq - if ( !context && elem.ownerDocument != document ) { - setDocument( elem ); - xml = !documentIsHTML; - } - while ( ( matcher = elementMatchers[ j++ ] ) ) { - if ( matcher( elem, context || document, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - - // They will have gone through all possible matchers - if ( ( elem = !matcher && elem ) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // `i` is now the count of elements visited above, and adding it to `matchedCount` - // makes the latter nonnegative. - matchedCount += i; - - // Apply set filters to unmatched elements - // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` - // equals `i`), unless we didn't visit _any_ elements in the above loop because we have - // no element matchers and no seed. - // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that - // case, which will result in a "00" `matchedCount` that differs from `i` but is also - // numerically zero. - if ( bySet && i !== matchedCount ) { - j = 0; - while ( ( matcher = setMatchers[ j++ ] ) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !( unmatched[ i ] || setMatched[ i ] ) ) { - setMatched[ i ] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[ i ] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( - selector, - matcherFromGroupMatchers( elementMatchers, setMatchers ) - ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( ( selector = compiled.selector || selector ) ); - - results = results || []; - - // Try to minimize operations if there is only one selector in the list and no seed - // (the latter of which guarantees us context) - if ( match.length === 1 ) { - - // Reduce context if the leading compound selector is an ID - tokens = match[ 0 ] = match[ 0 ].slice( 0 ); - if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && - context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { - - context = ( Expr.find[ "ID" ]( token.matches[ 0 ] - .replace( runescape, funescape ), context ) || [] )[ 0 ]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[ i ]; - - // Abort if we hit a combinator - if ( Expr.relative[ ( type = token.type ) ] ) { - break; - } - if ( ( find = Expr.find[ type ] ) ) { - - // Search, expanding context for leading sibling combinators - if ( ( seed = find( - token.matches[ 0 ].replace( runescape, funescape ), - rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || - context - ) ) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - !context || rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; - -// Support: Chrome 14-35+ -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert( function( el ) { - - // Should return 1, but returns 4 (following) - return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; -} ); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert( function( el ) { - el.innerHTML = ""; - return el.firstChild.getAttribute( "href" ) === "#"; -} ) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - } ); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert( function( el ) { - el.innerHTML = ""; - el.firstChild.setAttribute( "value", "" ); - return el.firstChild.getAttribute( "value" ) === ""; -} ) ) { - addHandle( "value", function( elem, _name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - } ); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert( function( el ) { - return el.getAttribute( "disabled" ) == null; -} ) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - ( val = elem.getAttributeNode( name ) ) && val.specified ? - val.value : - null; - } - } ); -} - -return Sizzle; - -} )( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; - -// Deprecated -jQuery.expr[ ":" ] = jQuery.expr.pseudos; -jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; -jQuery.escapeSelector = Sizzle.escape; - - - - -var dir = function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; -}; - - -var siblings = function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; -}; - - -var rneedsContext = jQuery.expr.match.needsContext; - - - -function nodeName( elem, name ) { - - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - -} -var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); - - - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - return !!qualifier.call( elem, i, elem ) !== not; - } ); - } - - // Single element - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - } ); - } - - // Arraylike of elements (jQuery, arguments, Array) - if ( typeof qualifier !== "string" ) { - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) > -1 ) !== not; - } ); - } - - // Filtered directly for both simple and complex selectors - return jQuery.filter( qualifier, elements, not ); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - if ( elems.length === 1 && elem.nodeType === 1 ) { - return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; - } - - return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - } ) ); -}; - -jQuery.fn.extend( { - find: function( selector ) { - var i, ret, - len = this.length, - self = this; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter( function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - } ) ); - } - - ret = this.pushStack( [] ); - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - return len > 1 ? jQuery.uniqueSort( ret ) : ret; - }, - filter: function( selector ) { - return this.pushStack( winnow( this, selector || [], false ) ); - }, - not: function( selector ) { - return this.pushStack( winnow( this, selector || [], true ) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -} ); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - // Shortcut simple #id case for speed - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - - init = jQuery.fn.init = function( selector, context, root ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Method init() accepts an alternate rootjQuery - // so migrate can support jQuery.sub (gh-2101) - root = root || rootjQuery; - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector[ 0 ] === "<" && - selector[ selector.length - 1 ] === ">" && - selector.length >= 3 ) { - - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && ( match[ 1 ] || !context ) ) { - - // HANDLE: $(html) -> $(array) - if ( match[ 1 ] ) { - context = context instanceof jQuery ? context[ 0 ] : context; - - // Option to run scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[ 1 ], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - - // Properties of context are called as methods if possible - if ( isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[ 2 ] ); - - if ( elem ) { - - // Inject the element directly into the jQuery object - this[ 0 ] = elem; - this.length = 1; - } - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || root ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this[ 0 ] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( isFunction( selector ) ) { - return root.ready !== undefined ? - root.ready( selector ) : - - // Execute immediately if ready is not present - selector( jQuery ); - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - - // Methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend( { - has: function( target ) { - var targets = jQuery( target, this ), - l = targets.length; - - return this.filter( function() { - var i = 0; - for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[ i ] ) ) { - return true; - } - } - } ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - targets = typeof selectors !== "string" && jQuery( selectors ); - - // Positional selectors never match, since there's no _selection_ context - if ( !rneedsContext.test( selectors ) ) { - for ( ; i < l; i++ ) { - for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { - - // Always skip document fragments - if ( cur.nodeType < 11 && ( targets ? - targets.index( cur ) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector( cur, selectors ) ) ) { - - matched.push( cur ); - break; - } - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); - }, - - // Determine the position of an element within the set - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; - } - - // Index in selector - if ( typeof elem === "string" ) { - return indexOf.call( jQuery( elem ), this[ 0 ] ); - } - - // Locate the position of the desired element - return indexOf.call( this, - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem - ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.uniqueSort( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - } -} ); - -function sibling( cur, dir ) { - while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} - return cur; -} - -jQuery.each( { - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, _i, until ) { - return dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, _i, until ) { - return dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, _i, until ) { - return dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return siblings( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return siblings( elem.firstChild ); - }, - contents: function( elem ) { - if ( elem.contentDocument != null && - - // Support: IE 11+ - // elements with no `data` attribute has an object - // `contentDocument` with a `null` prototype. - getProto( elem.contentDocument ) ) { - - return elem.contentDocument; - } - - // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only - // Treat the template element as a regular one in browsers that - // don't support it. - if ( nodeName( elem, "template" ) ) { - elem = elem.content || elem; - } - - return jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var matched = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - matched = jQuery.filter( selector, matched ); - } - - if ( this.length > 1 ) { - - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - jQuery.uniqueSort( matched ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - matched.reverse(); - } - } - - return this.pushStack( matched ); - }; -} ); -var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); - - - -// Convert String-formatted options into Object-formatted ones -function createOptions( options ) { - var object = {}; - jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { - object[ flag ] = true; - } ); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - createOptions( options ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - - // Last fire value for non-forgettable lists - memory, - - // Flag to know if list was already fired - fired, - - // Flag to prevent firing - locked, - - // Actual callback list - list = [], - - // Queue of execution data for repeatable lists - queue = [], - - // Index of currently firing callback (modified by add/remove as needed) - firingIndex = -1, - - // Fire callbacks - fire = function() { - - // Enforce single-firing - locked = locked || options.once; - - // Execute callbacks for all pending executions, - // respecting firingIndex overrides and runtime changes - fired = firing = true; - for ( ; queue.length; firingIndex = -1 ) { - memory = queue.shift(); - while ( ++firingIndex < list.length ) { - - // Run callback and check for early termination - if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && - options.stopOnFalse ) { - - // Jump to end and forget the data so .add doesn't re-fire - firingIndex = list.length; - memory = false; - } - } - } - - // Forget the data if we're done with it - if ( !options.memory ) { - memory = false; - } - - firing = false; - - // Clean up if we're done firing for good - if ( locked ) { - - // Keep an empty list if we have data for future add calls - if ( memory ) { - list = []; - - // Otherwise, this object is spent - } else { - list = ""; - } - } - }, - - // Actual Callbacks object - self = { - - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - - // If we have memory from a past run, we should fire after adding - if ( memory && !firing ) { - firingIndex = list.length - 1; - queue.push( memory ); - } - - ( function add( args ) { - jQuery.each( args, function( _, arg ) { - if ( isFunction( arg ) ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && toType( arg ) !== "string" ) { - - // Inspect recursively - add( arg ); - } - } ); - } )( arguments ); - - if ( memory && !firing ) { - fire(); - } - } - return this; - }, - - // Remove a callback from the list - remove: function() { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - - // Handle firing indexes - if ( index <= firingIndex ) { - firingIndex--; - } - } - } ); - return this; - }, - - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? - jQuery.inArray( fn, list ) > -1 : - list.length > 0; - }, - - // Remove all callbacks from the list - empty: function() { - if ( list ) { - list = []; - } - return this; - }, - - // Disable .fire and .add - // Abort any current/pending executions - // Clear all callbacks and values - disable: function() { - locked = queue = []; - list = memory = ""; - return this; - }, - disabled: function() { - return !list; - }, - - // Disable .fire - // Also disable .add unless we have memory (since it would have no effect) - // Abort any pending executions - lock: function() { - locked = queue = []; - if ( !memory && !firing ) { - list = memory = ""; - } - return this; - }, - locked: function() { - return !!locked; - }, - - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( !locked ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - queue.push( args ); - if ( !firing ) { - fire(); - } - } - return this; - }, - - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -function Identity( v ) { - return v; -} -function Thrower( ex ) { - throw ex; -} - -function adoptValue( value, resolve, reject, noValue ) { - var method; - - try { - - // Check for promise aspect first to privilege synchronous behavior - if ( value && isFunction( ( method = value.promise ) ) ) { - method.call( value ).done( resolve ).fail( reject ); - - // Other thenables - } else if ( value && isFunction( ( method = value.then ) ) ) { - method.call( value, resolve, reject ); - - // Other non-thenables - } else { - - // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: - // * false: [ value ].slice( 0 ) => resolve( value ) - // * true: [ value ].slice( 1 ) => resolve() - resolve.apply( undefined, [ value ].slice( noValue ) ); - } - - // For Promises/A+, convert exceptions into rejections - // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in - // Deferred#then to conditionally suppress rejection. - } catch ( value ) { - - // Support: Android 4.0 only - // Strict mode functions invoked without .call/.apply get global-object context - reject.apply( undefined, [ value ] ); - } -} - -jQuery.extend( { - - Deferred: function( func ) { - var tuples = [ - - // action, add listener, callbacks, - // ... .then handlers, argument index, [final state] - [ "notify", "progress", jQuery.Callbacks( "memory" ), - jQuery.Callbacks( "memory" ), 2 ], - [ "resolve", "done", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 0, "resolved" ], - [ "reject", "fail", jQuery.Callbacks( "once memory" ), - jQuery.Callbacks( "once memory" ), 1, "rejected" ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - "catch": function( fn ) { - return promise.then( null, fn ); - }, - - // Keep pipe for back-compat - pipe: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - - return jQuery.Deferred( function( newDefer ) { - jQuery.each( tuples, function( _i, tuple ) { - - // Map tuples (progress, done, fail) to arguments (done, fail, progress) - var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; - - // deferred.progress(function() { bind to newDefer or newDefer.notify }) - // deferred.done(function() { bind to newDefer or newDefer.resolve }) - // deferred.fail(function() { bind to newDefer or newDefer.reject }) - deferred[ tuple[ 1 ] ]( function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && isFunction( returned.promise ) ) { - returned.promise() - .progress( newDefer.notify ) - .done( newDefer.resolve ) - .fail( newDefer.reject ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( - this, - fn ? [ returned ] : arguments - ); - } - } ); - } ); - fns = null; - } ).promise(); - }, - then: function( onFulfilled, onRejected, onProgress ) { - var maxDepth = 0; - function resolve( depth, deferred, handler, special ) { - return function() { - var that = this, - args = arguments, - mightThrow = function() { - var returned, then; - - // Support: Promises/A+ section 2.3.3.3.3 - // https://promisesaplus.com/#point-59 - // Ignore double-resolution attempts - if ( depth < maxDepth ) { - return; - } - - returned = handler.apply( that, args ); - - // Support: Promises/A+ section 2.3.1 - // https://promisesaplus.com/#point-48 - if ( returned === deferred.promise() ) { - throw new TypeError( "Thenable self-resolution" ); - } - - // Support: Promises/A+ sections 2.3.3.1, 3.5 - // https://promisesaplus.com/#point-54 - // https://promisesaplus.com/#point-75 - // Retrieve `then` only once - then = returned && - - // Support: Promises/A+ section 2.3.4 - // https://promisesaplus.com/#point-64 - // Only check objects and functions for thenability - ( typeof returned === "object" || - typeof returned === "function" ) && - returned.then; - - // Handle a returned thenable - if ( isFunction( then ) ) { - - // Special processors (notify) just wait for resolution - if ( special ) { - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ) - ); - - // Normal processors (resolve) also hook into progress - } else { - - // ...and disregard older resolution values - maxDepth++; - - then.call( - returned, - resolve( maxDepth, deferred, Identity, special ), - resolve( maxDepth, deferred, Thrower, special ), - resolve( maxDepth, deferred, Identity, - deferred.notifyWith ) - ); - } - - // Handle all other returned values - } else { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Identity ) { - that = undefined; - args = [ returned ]; - } - - // Process the value(s) - // Default process is resolve - ( special || deferred.resolveWith )( that, args ); - } - }, - - // Only normal processors (resolve) catch and reject exceptions - process = special ? - mightThrow : - function() { - try { - mightThrow(); - } catch ( e ) { - - if ( jQuery.Deferred.exceptionHook ) { - jQuery.Deferred.exceptionHook( e, - process.stackTrace ); - } - - // Support: Promises/A+ section 2.3.3.3.4.1 - // https://promisesaplus.com/#point-61 - // Ignore post-resolution exceptions - if ( depth + 1 >= maxDepth ) { - - // Only substitute handlers pass on context - // and multiple values (non-spec behavior) - if ( handler !== Thrower ) { - that = undefined; - args = [ e ]; - } - - deferred.rejectWith( that, args ); - } - } - }; - - // Support: Promises/A+ section 2.3.3.3.1 - // https://promisesaplus.com/#point-57 - // Re-resolve promises immediately to dodge false rejection from - // subsequent errors - if ( depth ) { - process(); - } else { - - // Call an optional hook to record the stack, in case of exception - // since it's otherwise lost when execution goes async - if ( jQuery.Deferred.getStackHook ) { - process.stackTrace = jQuery.Deferred.getStackHook(); - } - window.setTimeout( process ); - } - }; - } - - return jQuery.Deferred( function( newDefer ) { - - // progress_handlers.add( ... ) - tuples[ 0 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onProgress ) ? - onProgress : - Identity, - newDefer.notifyWith - ) - ); - - // fulfilled_handlers.add( ... ) - tuples[ 1 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onFulfilled ) ? - onFulfilled : - Identity - ) - ); - - // rejected_handlers.add( ... ) - tuples[ 2 ][ 3 ].add( - resolve( - 0, - newDefer, - isFunction( onRejected ) ? - onRejected : - Thrower - ) - ); - } ).promise(); - }, - - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 5 ]; - - // promise.progress = list.add - // promise.done = list.add - // promise.fail = list.add - promise[ tuple[ 1 ] ] = list.add; - - // Handle state - if ( stateString ) { - list.add( - function() { - - // state = "resolved" (i.e., fulfilled) - // state = "rejected" - state = stateString; - }, - - // rejected_callbacks.disable - // fulfilled_callbacks.disable - tuples[ 3 - i ][ 2 ].disable, - - // rejected_handlers.disable - // fulfilled_handlers.disable - tuples[ 3 - i ][ 3 ].disable, - - // progress_callbacks.lock - tuples[ 0 ][ 2 ].lock, - - // progress_handlers.lock - tuples[ 0 ][ 3 ].lock - ); - } - - // progress_handlers.fire - // fulfilled_handlers.fire - // rejected_handlers.fire - list.add( tuple[ 3 ].fire ); - - // deferred.notify = function() { deferred.notifyWith(...) } - // deferred.resolve = function() { deferred.resolveWith(...) } - // deferred.reject = function() { deferred.rejectWith(...) } - deferred[ tuple[ 0 ] ] = function() { - deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); - return this; - }; - - // deferred.notifyWith = list.fireWith - // deferred.resolveWith = list.fireWith - // deferred.rejectWith = list.fireWith - deferred[ tuple[ 0 ] + "With" ] = list.fireWith; - } ); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( singleValue ) { - var - - // count of uncompleted subordinates - remaining = arguments.length, - - // count of unprocessed arguments - i = remaining, - - // subordinate fulfillment data - resolveContexts = Array( i ), - resolveValues = slice.call( arguments ), - - // the primary Deferred - primary = jQuery.Deferred(), - - // subordinate callback factory - updateFunc = function( i ) { - return function( value ) { - resolveContexts[ i ] = this; - resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( !( --remaining ) ) { - primary.resolveWith( resolveContexts, resolveValues ); - } - }; - }; - - // Single- and empty arguments are adopted like Promise.resolve - if ( remaining <= 1 ) { - adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, - !remaining ); - - // Use .then() to unwrap secondary thenables (cf. gh-3000) - if ( primary.state() === "pending" || - isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { - - return primary.then(); - } - } - - // Multiple arguments are aggregated like Promise.all array elements - while ( i-- ) { - adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); - } - - return primary.promise(); - } -} ); - - -// These usually indicate a programmer mistake during development, -// warn about them ASAP rather than swallowing them by default. -var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; - -jQuery.Deferred.exceptionHook = function( error, stack ) { - - // Support: IE 8 - 9 only - // Console exists when dev tools are open, which can happen at any time - if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { - window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); - } -}; - - - - -jQuery.readyException = function( error ) { - window.setTimeout( function() { - throw error; - } ); -}; - - - - -// The deferred used on DOM ready -var readyList = jQuery.Deferred(); - -jQuery.fn.ready = function( fn ) { - - readyList - .then( fn ) - - // Wrap jQuery.readyException in a function so that the lookup - // happens at the time of error handling instead of callback - // registration. - .catch( function( error ) { - jQuery.readyException( error ); - } ); - - return this; -}; - -jQuery.extend( { - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - } -} ); - -jQuery.ready.then = readyList.then; - -// The ready event handler and self cleanup method -function completed() { - document.removeEventListener( "DOMContentLoaded", completed ); - window.removeEventListener( "load", completed ); - jQuery.ready(); -} - -// Catch cases where $(document).ready() is called -// after the browser event has already occurred. -// Support: IE <=9 - 10 only -// Older IE sometimes signals "interactive" too soon -if ( document.readyState === "complete" || - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { - - // Handle it asynchronously to allow scripts the opportunity to delay ready - window.setTimeout( jQuery.ready ); - -} else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed ); -} - - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - len = elems.length, - bulk = key == null; - - // Sets many values - if ( toType( key ) === "object" ) { - chainable = true; - for ( i in key ) { - access( elems, fn, i, key[ i ], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, _key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < len; i++ ) { - fn( - elems[ i ], key, raw ? - value : - value.call( elems[ i ], i, fn( elems[ i ], key ) ) - ); - } - } - } - - if ( chainable ) { - return elems; - } - - // Gets - if ( bulk ) { - return fn.call( elems ); - } - - return len ? fn( elems[ 0 ], key ) : emptyGet; -}; - - -// Matches dashed string for camelizing -var rmsPrefix = /^-ms-/, - rdashAlpha = /-([a-z])/g; - -// Used by camelCase as callback to replace() -function fcamelCase( _all, letter ) { - return letter.toUpperCase(); -} - -// Convert dashed to camelCase; used by the css and data modules -// Support: IE <=9 - 11, Edge 12 - 15 -// Microsoft forgot to hump their vendor prefix (#9572) -function camelCase( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); -} -var acceptData = function( owner ) { - - // Accepts only: - // - Node - // - Node.ELEMENT_NODE - // - Node.DOCUMENT_NODE - // - Object - // - Any - return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); -}; - - - - -function Data() { - this.expando = jQuery.expando + Data.uid++; -} - -Data.uid = 1; - -Data.prototype = { - - cache: function( owner ) { - - // Check if the owner object already has a cache - var value = owner[ this.expando ]; - - // If not, create one - if ( !value ) { - value = {}; - - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return an empty object. - if ( acceptData( owner ) ) { - - // If it is a node unlikely to be stringify-ed or looped over - // use plain assignment - if ( owner.nodeType ) { - owner[ this.expando ] = value; - - // Otherwise secure it in a non-enumerable property - // configurable must be true to allow the property to be - // deleted when data is removed - } else { - Object.defineProperty( owner, this.expando, { - value: value, - configurable: true - } ); - } - } - } - - return value; - }, - set: function( owner, data, value ) { - var prop, - cache = this.cache( owner ); - - // Handle: [ owner, key, value ] args - // Always use camelCase key (gh-2257) - if ( typeof data === "string" ) { - cache[ camelCase( data ) ] = value; - - // Handle: [ owner, { properties } ] args - } else { - - // Copy the properties one-by-one to the cache object - for ( prop in data ) { - cache[ camelCase( prop ) ] = data[ prop ]; - } - } - return cache; - }, - get: function( owner, key ) { - return key === undefined ? - this.cache( owner ) : - - // Always use camelCase key (gh-2257) - owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; - }, - access: function( owner, key, value ) { - - // In cases where either: - // - // 1. No key was specified - // 2. A string key was specified, but no value provided - // - // Take the "read" path and allow the get method to determine - // which value to return, respectively either: - // - // 1. The entire cache object - // 2. The data stored at the key - // - if ( key === undefined || - ( ( key && typeof key === "string" ) && value === undefined ) ) { - - return this.get( owner, key ); - } - - // When the key is not a string, or both a key and value - // are specified, set or extend (existing objects) with either: - // - // 1. An object of properties - // 2. A key and value - // - this.set( owner, key, value ); - - // Since the "set" path can have two possible entry points - // return the expected data based on which path was taken[*] - return value !== undefined ? value : key; - }, - remove: function( owner, key ) { - var i, - cache = owner[ this.expando ]; - - if ( cache === undefined ) { - return; - } - - if ( key !== undefined ) { - - // Support array or space separated string of keys - if ( Array.isArray( key ) ) { - - // If key is an array of keys... - // We always set camelCase keys, so remove that. - key = key.map( camelCase ); - } else { - key = camelCase( key ); - - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - key = key in cache ? - [ key ] : - ( key.match( rnothtmlwhite ) || [] ); - } - - i = key.length; - - while ( i-- ) { - delete cache[ key[ i ] ]; - } - } - - // Remove the expando if there's no more data - if ( key === undefined || jQuery.isEmptyObject( cache ) ) { - - // Support: Chrome <=35 - 45 - // Webkit & Blink performance suffers when deleting properties - // from DOM nodes, so set to undefined instead - // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) - if ( owner.nodeType ) { - owner[ this.expando ] = undefined; - } else { - delete owner[ this.expando ]; - } - } - }, - hasData: function( owner ) { - var cache = owner[ this.expando ]; - return cache !== undefined && !jQuery.isEmptyObject( cache ); - } -}; -var dataPriv = new Data(); - -var dataUser = new Data(); - - - -// Implementation Summary -// -// 1. Enforce API surface and semantic compatibility with 1.9.x branch -// 2. Improve the module's maintainability by reducing the storage -// paths to a single mechanism. -// 3. Use the same single mechanism to support "private" and "user" data. -// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) -// 5. Avoid exposing implementation details on user objects (eg. expando properties) -// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /[A-Z]/g; - -function getData( data ) { - if ( data === "true" ) { - return true; - } - - if ( data === "false" ) { - return false; - } - - if ( data === "null" ) { - return null; - } - - // Only convert to a number if it doesn't change the string - if ( data === +data + "" ) { - return +data; - } - - if ( rbrace.test( data ) ) { - return JSON.parse( data ); - } - - return data; -} - -function dataAttr( elem, key, data ) { - var name; - - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = getData( data ); - } catch ( e ) {} - - // Make sure we set the data so it isn't changed later - dataUser.set( elem, key, data ); - } else { - data = undefined; - } - } - return data; -} - -jQuery.extend( { - hasData: function( elem ) { - return dataUser.hasData( elem ) || dataPriv.hasData( elem ); - }, - - data: function( elem, name, data ) { - return dataUser.access( elem, name, data ); - }, - - removeData: function( elem, name ) { - dataUser.remove( elem, name ); - }, - - // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to dataPriv methods, these can be deprecated. - _data: function( elem, name, data ) { - return dataPriv.access( elem, name, data ); - }, - - _removeData: function( elem, name ) { - dataPriv.remove( elem, name ); - } -} ); - -jQuery.fn.extend( { - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = dataUser.get( elem ); - - if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE 11 only - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = camelCase( name.slice( 5 ) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - dataPriv.set( elem, "hasDataAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each( function() { - dataUser.set( this, key ); - } ); - } - - return access( this, function( value ) { - var data; - - // The calling jQuery object (element matches) is not empty - // (and therefore has an element appears at this[ 0 ]) and the - // `value` parameter was not undefined. An empty jQuery object - // will result in `undefined` for elem = this[ 0 ] which will - // throw an exception if an attempt to read a data cache is made. - if ( elem && value === undefined ) { - - // Attempt to get data from the cache - // The key will always be camelCased in Data - data = dataUser.get( elem, key ); - if ( data !== undefined ) { - return data; - } - - // Attempt to "discover" the data in - // HTML5 custom data-* attrs - data = dataAttr( elem, key ); - if ( data !== undefined ) { - return data; - } - - // We tried really hard, but the data doesn't exist. - return; - } - - // Set the data... - this.each( function() { - - // We always store the camelCased key - dataUser.set( this, key, value ); - } ); - }, null, value, arguments.length > 1, null, true ); - }, - - removeData: function( key ) { - return this.each( function() { - dataUser.remove( this, key ); - } ); - } -} ); - - -jQuery.extend( { - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = dataPriv.get( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || Array.isArray( data ) ) { - queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // Clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // Not public - generate a queueHooks object, or return the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { - empty: jQuery.Callbacks( "once memory" ).add( function() { - dataPriv.remove( elem, [ type + "queue", key ] ); - } ) - } ); - } -} ); - -jQuery.fn.extend( { - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[ 0 ], type ); - } - - return data === undefined ? - this : - this.each( function() { - var queue = jQuery.queue( this, type, data ); - - // Ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - } ); - }, - dequeue: function( type ) { - return this.each( function() { - jQuery.dequeue( this, type ); - } ); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -} ); -var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; - -var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); - - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var documentElement = document.documentElement; - - - - var isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ); - }, - composed = { composed: true }; - - // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only - // Check attachment across shadow DOM boundaries when possible (gh-3504) - // Support: iOS 10.0-10.2 only - // Early iOS 10 versions support `attachShadow` but not `getRootNode`, - // leading to errors. We need to check for `getRootNode`. - if ( documentElement.getRootNode ) { - isAttached = function( elem ) { - return jQuery.contains( elem.ownerDocument, elem ) || - elem.getRootNode( composed ) === elem.ownerDocument; - }; - } -var isHiddenWithinTree = function( elem, el ) { - - // isHiddenWithinTree might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - - // Inline style trumps all - return elem.style.display === "none" || - elem.style.display === "" && - - // Otherwise, check computed style - // Support: Firefox <=43 - 45 - // Disconnected elements can have computed display: none, so first confirm that elem is - // in the document. - isAttached( elem ) && - - jQuery.css( elem, "display" ) === "none"; - }; - - - -function adjustCSS( elem, prop, valueParts, tween ) { - var adjusted, scale, - maxIterations = 20, - currentValue = tween ? - function() { - return tween.cur(); - } : - function() { - return jQuery.css( elem, prop, "" ); - }, - initial = currentValue(), - unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), - - // Starting value computation is required for potential unit mismatches - initialInUnit = elem.nodeType && - ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && - rcssNum.exec( jQuery.css( elem, prop ) ); - - if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { - - // Support: Firefox <=54 - // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) - initial = initial / 2; - - // Trust units reported by jQuery.css - unit = unit || initialInUnit[ 3 ]; - - // Iteratively approximate from a nonzero starting point - initialInUnit = +initial || 1; - - while ( maxIterations-- ) { - - // Evaluate and update our best guess (doubling guesses that zero out). - // Finish if the scale equals or crosses 1 (making the old*new product non-positive). - jQuery.style( elem, prop, initialInUnit + unit ); - if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { - maxIterations = 0; - } - initialInUnit = initialInUnit / scale; - - } - - initialInUnit = initialInUnit * 2; - jQuery.style( elem, prop, initialInUnit + unit ); - - // Make sure we update the tween properties later on - valueParts = valueParts || []; - } - - if ( valueParts ) { - initialInUnit = +initialInUnit || +initial || 0; - - // Apply relative offset (+=/-=) if specified - adjusted = valueParts[ 1 ] ? - initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : - +valueParts[ 2 ]; - if ( tween ) { - tween.unit = unit; - tween.start = initialInUnit; - tween.end = adjusted; - } - } - return adjusted; -} - - -var defaultDisplayMap = {}; - -function getDefaultDisplay( elem ) { - var temp, - doc = elem.ownerDocument, - nodeName = elem.nodeName, - display = defaultDisplayMap[ nodeName ]; - - if ( display ) { - return display; - } - - temp = doc.body.appendChild( doc.createElement( nodeName ) ); - display = jQuery.css( temp, "display" ); - - temp.parentNode.removeChild( temp ); - - if ( display === "none" ) { - display = "block"; - } - defaultDisplayMap[ nodeName ] = display; - - return display; -} - -function showHide( elements, show ) { - var display, elem, - values = [], - index = 0, - length = elements.length; - - // Determine new display value for elements that need to change - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - display = elem.style.display; - if ( show ) { - - // Since we force visibility upon cascade-hidden elements, an immediate (and slow) - // check is required in this first loop unless we have a nonempty display value (either - // inline or about-to-be-restored) - if ( display === "none" ) { - values[ index ] = dataPriv.get( elem, "display" ) || null; - if ( !values[ index ] ) { - elem.style.display = ""; - } - } - if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { - values[ index ] = getDefaultDisplay( elem ); - } - } else { - if ( display !== "none" ) { - values[ index ] = "none"; - - // Remember what we're overwriting - dataPriv.set( elem, "display", display ); - } - } - } - - // Set the display of the elements in a second loop to avoid constant reflow - for ( index = 0; index < length; index++ ) { - if ( values[ index ] != null ) { - elements[ index ].style.display = values[ index ]; - } - } - - return elements; -} - -jQuery.fn.extend( { - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each( function() { - if ( isHiddenWithinTree( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - } ); - } -} ); -var rcheckableType = ( /^(?:checkbox|radio)$/i ); - -var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); - -var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); - - - -( function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // Support: Android 4.0 - 4.3 only - // Check state lost if the name is set (#11217) - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Android <=4.1 only - // Older WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE <=11 only - // Make sure textarea (and checkbox) defaultValue is properly cloned - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - - // Support: IE <=9 only - // IE <=9 replaces "; - support.option = !!div.lastChild; -} )(); - - -// We have to close these tags to support XHTML (#13200) -var wrapMap = { - - // XHTML parsers do not magically insert elements in the - // same way that tag soup parsers do. So we cannot shorten - // this by omitting or other required elements. - thead: [ 1, "", "
" ], - col: [ 2, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - _default: [ 0, "", "" ] -}; - -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// Support: IE <=9 only -if ( !support.option ) { - wrapMap.optgroup = wrapMap.option = [ 1, "" ]; -} - - -function getAll( context, tag ) { - - // Support: IE <=9 - 11 only - // Use typeof to avoid zero-argument method invocation on host objects (#15151) - var ret; - - if ( typeof context.getElementsByTagName !== "undefined" ) { - ret = context.getElementsByTagName( tag || "*" ); - - } else if ( typeof context.querySelectorAll !== "undefined" ) { - ret = context.querySelectorAll( tag || "*" ); - - } else { - ret = []; - } - - if ( tag === undefined || tag && nodeName( context, tag ) ) { - return jQuery.merge( [ context ], ret ); - } - - return ret; -} - - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - dataPriv.set( - elems[ i ], - "globalEval", - !refElements || dataPriv.get( refElements[ i ], "globalEval" ) - ); - } -} - - -var rhtml = /<|&#?\w+;/; - -function buildFragment( elems, context, scripts, selection, ignored ) { - var elem, tmp, tag, wrap, attached, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( toType( elem ) === "object" ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Ensure the created nodes are orphaned (#12392) - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - i = 0; - while ( ( elem = nodes[ i++ ] ) ) { - - // Skip elements already in the context collection (trac-4087) - if ( selection && jQuery.inArray( elem, selection ) > -1 ) { - if ( ignored ) { - ignored.push( elem ); - } - continue; - } - - attached = isAttached( elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( attached ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( ( elem = tmp[ j++ ] ) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; -} - - -var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -// Support: IE <=9 - 11+ -// focus() and blur() are asynchronous, except when they are no-op. -// So expect focus to be synchronous when the element is already active, -// and blur to be synchronous when the element is not already active. -// (focus and blur are always synchronous in other supported browsers, -// this just defines when we can count on it). -function expectSync( elem, type ) { - return ( elem === safeActiveElement() ) === ( type === "focus" ); -} - -// Support: IE <=9 only -// Accessing document.activeElement can throw unexpectedly -// https://bugs.jquery.com/ticket/13393 -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -function on( elem, types, selector, data, fn, one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - on( elem, type, selector, data, types[ type ], one ); - } - return elem; - } - - if ( data == null && fn == null ) { - - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return elem; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return elem.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - } ); -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.get( elem ); - - // Only attach events to objects that accept data - if ( !acceptData( elem ) ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Ensure that invalid selectors throw exceptions at attach time - // Evaluate against documentElement in case elem is a non-element node (e.g., document) - if ( selector ) { - jQuery.find.matchesSelector( documentElement, selector ); - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !( events = elemData.events ) ) { - events = elemData.events = Object.create( null ); - } - if ( !( eventHandle = elemData.handle ) ) { - eventHandle = elemData.handle = function( e ) { - - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend( { - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join( "." ) - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !( handlers = events[ type ] ) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener if the special events handler returns false - if ( !special.setup || - special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); - - if ( !elemData || !( events = elemData.events ) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[ t ] ) || []; - type = origType = tmp[ 1 ]; - namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[ 2 ] && - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || - selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || - special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove data and the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - dataPriv.remove( elem, "handle events" ); - } - }, - - dispatch: function( nativeEvent ) { - - var i, j, ret, matched, handleObj, handlerQueue, - args = new Array( arguments.length ), - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( nativeEvent ), - - handlers = ( - dataPriv.get( this, "events" ) || Object.create( null ) - )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[ 0 ] = event; - - for ( i = 1; i < arguments.length; i++ ) { - args[ i ] = arguments[ i ]; - } - - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( ( handleObj = matched.handlers[ j++ ] ) && - !event.isImmediatePropagationStopped() ) { - - // If the event is namespaced, then each handler is only invoked if it is - // specially universal or its namespaces are a superset of the event's. - if ( !event.rnamespace || handleObj.namespace === false || - event.rnamespace.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || - handleObj.handler ).apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( ( event.result = ret ) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, handleObj, sel, matchedHandlers, matchedSelectors, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - if ( delegateCount && - - // Support: IE <=9 - // Black-hole SVG instance trees (trac-13180) - cur.nodeType && - - // Support: Firefox <=42 - // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) - // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click - // Support: IE 11 only - // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) - !( event.type === "click" && event.button >= 1 ) ) { - - for ( ; cur !== this; cur = cur.parentNode || this ) { - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { - matchedHandlers = []; - matchedSelectors = {}; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matchedSelectors[ sel ] === undefined ) { - matchedSelectors[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) > -1 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matchedSelectors[ sel ] ) { - matchedHandlers.push( handleObj ); - } - } - if ( matchedHandlers.length ) { - handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); - } - } - } - } - - // Add the remaining (directly-bound) handlers - cur = this; - if ( delegateCount < handlers.length ) { - handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); - } - - return handlerQueue; - }, - - addProp: function( name, hook ) { - Object.defineProperty( jQuery.Event.prototype, name, { - enumerable: true, - configurable: true, - - get: isFunction( hook ) ? - function() { - if ( this.originalEvent ) { - return hook( this.originalEvent ); - } - } : - function() { - if ( this.originalEvent ) { - return this.originalEvent[ name ]; - } - }, - - set: function( value ) { - Object.defineProperty( this, name, { - enumerable: true, - configurable: true, - writable: true, - value: value - } ); - } - } ); - }, - - fix: function( originalEvent ) { - return originalEvent[ jQuery.expando ] ? - originalEvent : - new jQuery.Event( originalEvent ); - }, - - special: { - load: { - - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - click: { - - // Utilize native event to ensure correct state for checkable inputs - setup: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Claim the first handler - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - // dataPriv.set( el, "click", ... ) - leverageNative( el, "click", returnTrue ); - } - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function( data ) { - - // For mutual compressibility with _default, replace `this` access with a local var. - // `|| data` is dead code meant only to preserve the variable through minification. - var el = this || data; - - // Force setup before triggering a click - if ( rcheckableType.test( el.type ) && - el.click && nodeName( el, "input" ) ) { - - leverageNative( el, "click" ); - } - - // Return non-false to allow normal event-path propagation - return true; - }, - - // For cross-browser consistency, suppress native .click() on links - // Also prevent it if we're currently inside a leveraged native-event stack - _default: function( event ) { - var target = event.target; - return rcheckableType.test( target.type ) && - target.click && nodeName( target, "input" ) && - dataPriv.get( target, "click" ) || - nodeName( target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - } -}; - -// Ensure the presence of an event listener that handles manually-triggered -// synthetic events by interrupting progress until reinvoked in response to -// *native* events that it fires directly, ensuring that state changes have -// already occurred before other listeners are invoked. -function leverageNative( el, type, expectSync ) { - - // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add - if ( !expectSync ) { - if ( dataPriv.get( el, type ) === undefined ) { - jQuery.event.add( el, type, returnTrue ); - } - return; - } - - // Register the controller as a special universal handler for all event namespaces - dataPriv.set( el, type, false ); - jQuery.event.add( el, type, { - namespace: false, - handler: function( event ) { - var notAsync, result, - saved = dataPriv.get( this, type ); - - if ( ( event.isTrigger & 1 ) && this[ type ] ) { - - // Interrupt processing of the outer synthetic .trigger()ed event - // Saved data should be false in such cases, but might be a leftover capture object - // from an async native handler (gh-4350) - if ( !saved.length ) { - - // Store arguments for use when handling the inner native event - // There will always be at least one argument (an event object), so this array - // will not be confused with a leftover capture object. - saved = slice.call( arguments ); - dataPriv.set( this, type, saved ); - - // Trigger the native event and capture its result - // Support: IE <=9 - 11+ - // focus() and blur() are asynchronous - notAsync = expectSync( this, type ); - this[ type ](); - result = dataPriv.get( this, type ); - if ( saved !== result || notAsync ) { - dataPriv.set( this, type, false ); - } else { - result = {}; - } - if ( saved !== result ) { - - // Cancel the outer synthetic event - event.stopImmediatePropagation(); - event.preventDefault(); - - // Support: Chrome 86+ - // In Chrome, if an element having a focusout handler is blurred by - // clicking outside of it, it invokes the handler synchronously. If - // that handler calls `.remove()` on the element, the data is cleared, - // leaving `result` undefined. We need to guard against this. - return result && result.value; - } - - // If this is an inner synthetic event for an event with a bubbling surrogate - // (focus or blur), assume that the surrogate already propagated from triggering the - // native event and prevent that from happening again here. - // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the - // bubbling surrogate propagates *after* the non-bubbling base), but that seems - // less bad than duplication. - } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { - event.stopPropagation(); - } - - // If this is a native event triggered above, everything is now in order - // Fire an inner synthetic event with the original arguments - } else if ( saved.length ) { - - // ...and capture the result - dataPriv.set( this, type, { - value: jQuery.event.trigger( - - // Support: IE <=9 - 11+ - // Extend with the prototype to reset the above stopImmediatePropagation() - jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), - saved.slice( 1 ), - this - ) - } ); - - // Abort handling of the native event - event.stopImmediatePropagation(); - } - } - } ); -} - -jQuery.removeEvent = function( elem, type, handle ) { - - // This "if" is needed for plain objects - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle ); - } -}; - -jQuery.Event = function( src, props ) { - - // Allow instantiation without the 'new' keyword - if ( !( this instanceof jQuery.Event ) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - - // Support: Android <=2.3 only - src.returnValue === false ? - returnTrue : - returnFalse; - - // Create target properties - // Support: Safari <=6 - 7 only - // Target should not be a text node (#504, #13143) - this.target = ( src.target && src.target.nodeType === 3 ) ? - src.target.parentNode : - src.target; - - this.currentTarget = src.currentTarget; - this.relatedTarget = src.relatedTarget; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || Date.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - constructor: jQuery.Event, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - isSimulated: false, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - - if ( e && !this.isSimulated ) { - e.preventDefault(); - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopPropagation(); - } - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && !this.isSimulated ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Includes all common event props including KeyEvent and MouseEvent specific props -jQuery.each( { - altKey: true, - bubbles: true, - cancelable: true, - changedTouches: true, - ctrlKey: true, - detail: true, - eventPhase: true, - metaKey: true, - pageX: true, - pageY: true, - shiftKey: true, - view: true, - "char": true, - code: true, - charCode: true, - key: true, - keyCode: true, - button: true, - buttons: true, - clientX: true, - clientY: true, - offsetX: true, - offsetY: true, - pointerId: true, - pointerType: true, - screenX: true, - screenY: true, - targetTouches: true, - toElement: true, - touches: true, - which: true -}, jQuery.event.addProp ); - -jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { - jQuery.event.special[ type ] = { - - // Utilize native event if possible so blur/focus sequence is correct - setup: function() { - - // Claim the first handler - // dataPriv.set( this, "focus", ... ) - // dataPriv.set( this, "blur", ... ) - leverageNative( this, type, expectSync ); - - // Return false to allow normal processing in the caller - return false; - }, - trigger: function() { - - // Force setup before trigger - leverageNative( this, type ); - - // Return non-false to allow normal event-path propagation - return true; - }, - - // Suppress native focus or blur as it's already being fired - // in leverageNative. - _default: function() { - return true; - }, - - delegateType: delegateType - }; -} ); - -// Create mouseenter/leave events using mouseover/out and event-time checks -// so that event delegation works in jQuery. -// Do the same for pointerenter/pointerleave and pointerover/pointerout -// -// Support: Safari 7 only -// Safari sends mouseenter too often; see: -// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 -// for the description of the bug (it existed in older Chrome versions as well). -jQuery.each( { - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mouseenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -} ); - -jQuery.fn.extend( { - - on: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn ); - }, - one: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? - handleObj.origType + "." + handleObj.namespace : - handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each( function() { - jQuery.event.remove( this, types, fn, selector ); - } ); - } -} ); - - -var - - // Support: IE <=10 - 11, Edge 12 - 13 only - // In IE/Edge using regex groups here causes severe slowdowns. - // See https://connect.microsoft.com/IE/feedback/details/1736512/ - rnoInnerhtml = /\s*$/g; - -// Prefer a tbody over its parent table for containing new rows -function manipulationTarget( elem, content ) { - if ( nodeName( elem, "table" ) && - nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { - - return jQuery( elem ).children( "tbody" )[ 0 ] || elem; - } - - return elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { - elem.type = elem.type.slice( 5 ); - } else { - elem.removeAttribute( "type" ); - } - - return elem; -} - -function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, udataOld, udataCur, events; - - if ( dest.nodeType !== 1 ) { - return; - } - - // 1. Copy private data: events, handlers, etc. - if ( dataPriv.hasData( src ) ) { - pdataOld = dataPriv.get( src ); - events = pdataOld.events; - - if ( events ) { - dataPriv.remove( dest, "handle events" ); - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - } - - // 2. Copy user data - if ( dataUser.hasData( src ) ) { - udataOld = dataUser.access( src ); - udataCur = jQuery.extend( {}, udataOld ); - - dataUser.set( dest, udataCur ); - } -} - -// Fix IE bugs, see support tests -function fixInput( src, dest ) { - var nodeName = dest.nodeName.toLowerCase(); - - // Fails to persist the checked state of a cloned checkbox or radio button. - if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - dest.checked = src.checked; - - // Fails to return the selected option to the default selected state when cloning options - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -function domManip( collection, args, callback, ignored ) { - - // Flatten any nested arrays - args = flat( args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = collection.length, - iNoClone = l - 1, - value = args[ 0 ], - valueIsFunction = isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( valueIsFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return collection.each( function( index ) { - var self = collection.eq( index ); - if ( valueIsFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - domManip( self, args, callback, ignored ); - } ); - } - - if ( l ) { - fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - // Require either new content or an interest in ignored elements to invoke the callback - if ( first || ignored ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item - // instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( collection[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !dataPriv.access( node, "globalEval" ) && - jQuery.contains( doc, node ) ) { - - if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { - - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl && !node.noModule ) { - jQuery._evalUrl( node.src, { - nonce: node.nonce || node.getAttribute( "nonce" ) - }, doc ); - } - } else { - DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); - } - } - } - } - } - } - - return collection; -} - -function remove( elem, selector, keepData ) { - var node, - nodes = selector ? jQuery.filter( selector, elem ) : elem, - i = 0; - - for ( ; ( node = nodes[ i ] ) != null; i++ ) { - if ( !keepData && node.nodeType === 1 ) { - jQuery.cleanData( getAll( node ) ); - } - - if ( node.parentNode ) { - if ( keepData && isAttached( node ) ) { - setGlobalEval( getAll( node, "script" ) ); - } - node.parentNode.removeChild( node ); - } - } - - return elem; -} - -jQuery.extend( { - htmlPrefilter: function( html ) { - return html; - }, - - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = isAttached( elem ); - - // Fix IE cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { - - // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], destElements[ i ] ); - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - // Return the cloned set - return clone; - }, - - cleanData: function( elems ) { - var data, elem, type, - special = jQuery.event.special, - i = 0; - - for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { - if ( acceptData( elem ) ) { - if ( ( data = elem[ dataPriv.expando ] ) ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataPriv.expando ] = undefined; - } - if ( elem[ dataUser.expando ] ) { - - // Support: Chrome <=35 - 45+ - // Assign undefined instead of using delete, see Data#remove - elem[ dataUser.expando ] = undefined; - } - } - } - } -} ); - -jQuery.fn.extend( { - detach: function( selector ) { - return remove( this, selector, true ); - }, - - remove: function( selector ) { - return remove( this, selector ); - }, - - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().each( function() { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - this.textContent = value; - } - } ); - }, null, value, arguments.length ); - }, - - append: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - } ); - }, - - prepend: function() { - return domManip( this, arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - } ); - }, - - before: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - } ); - }, - - after: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - } ); - }, - - empty: function() { - var elem, - i = 0; - - for ( ; ( elem = this[ i ] ) != null; i++ ) { - if ( elem.nodeType === 1 ) { - - // Prevent memory leaks - jQuery.cleanData( getAll( elem, false ) ); - - // Remove any remaining nodes - elem.textContent = ""; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - } ); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined && elem.nodeType === 1 ) { - return elem.innerHTML; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = jQuery.htmlPrefilter( value ); - - try { - for ( ; i < l; i++ ) { - elem = this[ i ] || {}; - - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch ( e ) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var ignored = []; - - // Make the changes, replacing each non-ignored context element with the new content - return domManip( this, arguments, function( elem ) { - var parent = this.parentNode; - - if ( jQuery.inArray( this, ignored ) < 0 ) { - jQuery.cleanData( getAll( this ) ); - if ( parent ) { - parent.replaceChild( elem, this ); - } - } - - // Force callback invocation - }, ignored ); - } -} ); - -jQuery.each( { - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1, - i = 0; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Support: Android <=4.0 only, PhantomJS 1 only - // .get() because push.apply(_, arraylike) throws on ancient WebKit - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -} ); -var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); - -var getStyles = function( elem ) { - - // Support: IE <=11 only, Firefox <=30 (#15098, #14150) - // IE throws on elements created in popups - // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" - var view = elem.ownerDocument.defaultView; - - if ( !view || !view.opener ) { - view = window; - } - - return view.getComputedStyle( elem ); - }; - -var swap = function( elem, options, callback ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.call( elem ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; -}; - - -var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); - - - -( function() { - - // Executing both pixelPosition & boxSizingReliable tests require only one layout - // so they're executed at the same time to save the second computation. - function computeStyleTests() { - - // This is a singleton, we need to execute it only once - if ( !div ) { - return; - } - - container.style.cssText = "position:absolute;left:-11111px;width:60px;" + - "margin-top:1px;padding:0;border:0"; - div.style.cssText = - "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + - "margin:auto;border:1px;padding:1px;" + - "width:60%;top:1%"; - documentElement.appendChild( container ).appendChild( div ); - - var divStyle = window.getComputedStyle( div ); - pixelPositionVal = divStyle.top !== "1%"; - - // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 - reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; - - // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 - // Some styles come back with percentage values, even though they shouldn't - div.style.right = "60%"; - pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; - - // Support: IE 9 - 11 only - // Detect misreporting of content dimensions for box-sizing:border-box elements - boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; - - // Support: IE 9 only - // Detect overflow:scroll screwiness (gh-3699) - // Support: Chrome <=64 - // Don't get tricked when zoom affects offsetWidth (gh-4029) - div.style.position = "absolute"; - scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; - - documentElement.removeChild( container ); - - // Nullify the div so it wouldn't be stored in the memory and - // it will also be a sign that checks already performed - div = null; - } - - function roundPixelMeasures( measure ) { - return Math.round( parseFloat( measure ) ); - } - - var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, - reliableTrDimensionsVal, reliableMarginLeftVal, - container = document.createElement( "div" ), - div = document.createElement( "div" ); - - // Finish early in limited (non-browser) environments - if ( !div.style ) { - return; - } - - // Support: IE <=9 - 11 only - // Style of cloned element affects source element cloned (#8908) - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - jQuery.extend( support, { - boxSizingReliable: function() { - computeStyleTests(); - return boxSizingReliableVal; - }, - pixelBoxStyles: function() { - computeStyleTests(); - return pixelBoxStylesVal; - }, - pixelPosition: function() { - computeStyleTests(); - return pixelPositionVal; - }, - reliableMarginLeft: function() { - computeStyleTests(); - return reliableMarginLeftVal; - }, - scrollboxSize: function() { - computeStyleTests(); - return scrollboxSizeVal; - }, - - // Support: IE 9 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Behavior in IE 9 is more subtle than in newer versions & it passes - // some versions of this test; make sure not to make it pass there! - // - // Support: Firefox 70+ - // Only Firefox includes border widths - // in computed dimensions. (gh-4529) - reliableTrDimensions: function() { - var table, tr, trChild, trStyle; - if ( reliableTrDimensionsVal == null ) { - table = document.createElement( "table" ); - tr = document.createElement( "tr" ); - trChild = document.createElement( "div" ); - - table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; - tr.style.cssText = "border:1px solid"; - - // Support: Chrome 86+ - // Height set through cssText does not get applied. - // Computed height then comes back as 0. - tr.style.height = "1px"; - trChild.style.height = "9px"; - - // Support: Android 8 Chrome 86+ - // In our bodyBackground.html iframe, - // display for all div elements is set to "inline", - // which causes a problem only in Android 8 Chrome 86. - // Ensuring the div is display: block - // gets around this issue. - trChild.style.display = "block"; - - documentElement - .appendChild( table ) - .appendChild( tr ) - .appendChild( trChild ); - - trStyle = window.getComputedStyle( tr ); - reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + - parseInt( trStyle.borderTopWidth, 10 ) + - parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; - - documentElement.removeChild( table ); - } - return reliableTrDimensionsVal; - } - } ); -} )(); - - -function curCSS( elem, name, computed ) { - var width, minWidth, maxWidth, ret, - - // Support: Firefox 51+ - // Retrieving style before computed somehow - // fixes an issue with getting wrong values - // on detached elements - style = elem.style; - - computed = computed || getStyles( elem ); - - // getPropertyValue is needed for: - // .css('filter') (IE 9 only, #12537) - // .css('--customProperty) (#3144) - if ( computed ) { - ret = computed.getPropertyValue( name ) || computed[ name ]; - - if ( ret === "" && !isAttached( elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Android Browser returns percentage for some values, - // but width seems to be reliably pixels. - // This is against the CSSOM draft spec: - // https://drafts.csswg.org/cssom/#resolved-values - if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret !== undefined ? - - // Support: IE <=9 - 11 only - // IE returns zIndex value as an integer. - ret + "" : - ret; -} - - -function addGetHookIf( conditionFn, hookFn ) { - - // Define the hook, we'll check on the first run if it's really needed. - return { - get: function() { - if ( conditionFn() ) { - - // Hook not needed (or it's not possible to use it due - // to missing dependency), remove it. - delete this.get; - return; - } - - // Hook needed; redefine it so that the support test is not executed again. - return ( this.get = hookFn ).apply( this, arguments ); - } - }; -} - - -var cssPrefixes = [ "Webkit", "Moz", "ms" ], - emptyStyle = document.createElement( "div" ).style, - vendorProps = {}; - -// Return a vendor-prefixed property or undefined -function vendorPropName( name ) { - - // Check for vendor prefixed names - var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in emptyStyle ) { - return name; - } - } -} - -// Return a potentially-mapped jQuery.cssProps or vendor prefixed property -function finalPropName( name ) { - var final = jQuery.cssProps[ name ] || vendorProps[ name ]; - - if ( final ) { - return final; - } - if ( name in emptyStyle ) { - return name; - } - return vendorProps[ name ] = vendorPropName( name ) || name; -} - - -var - - // Swappable if display is none or starts with table - // except "table", "table-cell", or "table-caption" - // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rcustomProp = /^--/, - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: "0", - fontWeight: "400" - }; - -function setPositiveNumber( _elem, value, subtract ) { - - // Any relative (+/-) values have already been - // normalized at this point - var matches = rcssNum.exec( value ); - return matches ? - - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : - value; -} - -function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { - var i = dimension === "width" ? 1 : 0, - extra = 0, - delta = 0; - - // Adjustment may not be necessary - if ( box === ( isBorderBox ? "border" : "content" ) ) { - return 0; - } - - for ( ; i < 4; i += 2 ) { - - // Both box models exclude margin - if ( box === "margin" ) { - delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); - } - - // If we get here with a content-box, we're seeking "padding" or "border" or "margin" - if ( !isBorderBox ) { - - // Add padding - delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // For "border" or "margin", add border - if ( box !== "padding" ) { - delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - - // But still keep track of it otherwise - } else { - extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - - // If we get here with a border-box (content + padding + border), we're seeking "content" or - // "padding" or "margin" - } else { - - // For "content", subtract padding - if ( box === "content" ) { - delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // For "content" or "padding", subtract border - if ( box !== "margin" ) { - delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - // Account for positive content-box scroll gutter when requested by providing computedVal - if ( !isBorderBox && computedVal >= 0 ) { - - // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border - // Assuming integer scroll gutter, subtract the rest and round down - delta += Math.max( 0, Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - computedVal - - delta - - extra - - 0.5 - - // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter - // Use an explicit zero to avoid NaN (gh-3964) - ) ) || 0; - } - - return delta; -} - -function getWidthOrHeight( elem, dimension, extra ) { - - // Start with computed style - var styles = getStyles( elem ), - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). - // Fake content-box until we know it's needed to know the true value. - boxSizingNeeded = !support.boxSizingReliable() || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - valueIsBorderBox = isBorderBox, - - val = curCSS( elem, dimension, styles ), - offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); - - // Support: Firefox <=54 - // Return a confounding non-pixel value or feign ignorance, as appropriate. - if ( rnumnonpx.test( val ) ) { - if ( !extra ) { - return val; - } - val = "auto"; - } - - - // Support: IE 9 - 11 only - // Use offsetWidth/offsetHeight for when box sizing is unreliable. - // In those cases, the computed value can be trusted to be border-box. - if ( ( !support.boxSizingReliable() && isBorderBox || - - // Support: IE 10 - 11+, Edge 15 - 18+ - // IE/Edge misreport `getComputedStyle` of table rows with width/height - // set in CSS while `offset*` properties report correct values. - // Interestingly, in some cases IE 9 doesn't suffer from this issue. - !support.reliableTrDimensions() && nodeName( elem, "tr" ) || - - // Fall back to offsetWidth/offsetHeight when value is "auto" - // This happens for inline elements with no explicit setting (gh-3571) - val === "auto" || - - // Support: Android <=4.1 - 4.3 only - // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) - !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && - - // Make sure the element is visible & connected - elem.getClientRects().length ) { - - isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // Where available, offsetWidth/offsetHeight approximate border box dimensions. - // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the - // retrieved value as a content box dimension. - valueIsBorderBox = offsetProp in elem; - if ( valueIsBorderBox ) { - val = elem[ offsetProp ]; - } - } - - // Normalize "" and auto - val = parseFloat( val ) || 0; - - // Adjust for the element's box model - return ( val + - boxModelAdjustment( - elem, - dimension, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles, - - // Provide the current computed size to request scroll gutter calculation (gh-3589) - val - ) - ) + "px"; -} - -jQuery.extend( { - - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - "animationIterationCount": true, - "columnCount": true, - "fillOpacity": true, - "flexGrow": true, - "flexShrink": true, - "fontWeight": true, - "gridArea": true, - "gridColumn": true, - "gridColumnEnd": true, - "gridColumnStart": true, - "gridRow": true, - "gridRowEnd": true, - "gridRowStart": true, - "lineHeight": true, - "opacity": true, - "order": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: {}, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ), - style = elem.style; - - // Make sure that we're working with the right name. We don't - // want to query the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Gets hook for the prefixed version, then unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // Convert "+=" or "-=" to relative numbers (#7345) - if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { - value = adjustCSS( elem, name, ret ); - - // Fixes bug #9237 - type = "number"; - } - - // Make sure that null and NaN values aren't set (#7116) - if ( value == null || value !== value ) { - return; - } - - // If a number was passed in, add the unit (except for certain CSS properties) - // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append - // "px" to a few hardcoded values. - if ( type === "number" && !isCustomProp ) { - value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); - } - - // background-* props affect original clone's values - if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !( "set" in hooks ) || - ( value = hooks.set( elem, value, extra ) ) !== undefined ) { - - if ( isCustomProp ) { - style.setProperty( name, value ); - } else { - style[ name ] = value; - } - } - - } else { - - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && - ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { - - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var val, num, hooks, - origName = camelCase( name ), - isCustomProp = rcustomProp.test( name ); - - // Make sure that we're working with the right name. We don't - // want to modify the value if it is a CSS custom property - // since they are user-defined. - if ( !isCustomProp ) { - name = finalPropName( origName ); - } - - // Try prefixed name followed by the unprefixed name - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - // Convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Make numeric if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || isFinite( num ) ? num || 0 : val; - } - - return val; - } -} ); - -jQuery.each( [ "height", "width" ], function( _i, dimension ) { - jQuery.cssHooks[ dimension ] = { - get: function( elem, computed, extra ) { - if ( computed ) { - - // Certain elements can have dimension info if we invisibly show them - // but it must have a current display style that would benefit - return rdisplayswap.test( jQuery.css( elem, "display" ) ) && - - // Support: Safari 8+ - // Table columns in Safari have non-zero offsetWidth & zero - // getBoundingClientRect().width unless display is changed. - // Support: IE <=11 only - // Running getBoundingClientRect on a disconnected node - // in IE throws an error. - ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? - swap( elem, cssShow, function() { - return getWidthOrHeight( elem, dimension, extra ); - } ) : - getWidthOrHeight( elem, dimension, extra ); - } - }, - - set: function( elem, value, extra ) { - var matches, - styles = getStyles( elem ), - - // Only read styles.position if the test has a chance to fail - // to avoid forcing a reflow. - scrollboxSizeBuggy = !support.scrollboxSize() && - styles.position === "absolute", - - // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) - boxSizingNeeded = scrollboxSizeBuggy || extra, - isBorderBox = boxSizingNeeded && - jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - subtract = extra ? - boxModelAdjustment( - elem, - dimension, - extra, - isBorderBox, - styles - ) : - 0; - - // Account for unreliable border-box dimensions by comparing offset* to computed and - // faking a content-box to get border and padding (gh-3699) - if ( isBorderBox && scrollboxSizeBuggy ) { - subtract -= Math.ceil( - elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - - parseFloat( styles[ dimension ] ) - - boxModelAdjustment( elem, dimension, "border", false, styles ) - - 0.5 - ); - } - - // Convert to pixels if value adjustment is needed - if ( subtract && ( matches = rcssNum.exec( value ) ) && - ( matches[ 3 ] || "px" ) !== "px" ) { - - elem.style[ dimension ] = value; - value = jQuery.css( elem, dimension ); - } - - return setPositiveNumber( elem, value, subtract ); - } - }; -} ); - -jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, - function( elem, computed ) { - if ( computed ) { - return ( parseFloat( curCSS( elem, "marginLeft" ) ) || - elem.getBoundingClientRect().left - - swap( elem, { marginLeft: 0 }, function() { - return elem.getBoundingClientRect().left; - } ) - ) + "px"; - } - } -); - -// These hooks are used by animate to expand properties -jQuery.each( { - margin: "", - padding: "", - border: "Width" -}, function( prefix, suffix ) { - jQuery.cssHooks[ prefix + suffix ] = { - expand: function( value ) { - var i = 0, - expanded = {}, - - // Assumes a single number if not a string - parts = typeof value === "string" ? value.split( " " ) : [ value ]; - - for ( ; i < 4; i++ ) { - expanded[ prefix + cssExpand[ i ] + suffix ] = - parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; - } - - return expanded; - } - }; - - if ( prefix !== "margin" ) { - jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; - } -} ); - -jQuery.fn.extend( { - css: function( name, value ) { - return access( this, function( elem, name, value ) { - var styles, len, - map = {}, - i = 0; - - if ( Array.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - } -} ); - - -function Tween( elem, options, prop, end, easing ) { - return new Tween.prototype.init( elem, options, prop, end, easing ); -} -jQuery.Tween = Tween; - -Tween.prototype = { - constructor: Tween, - init: function( elem, options, prop, end, easing, unit ) { - this.elem = elem; - this.prop = prop; - this.easing = easing || jQuery.easing._default; - this.options = options; - this.start = this.now = this.cur(); - this.end = end; - this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); - }, - cur: function() { - var hooks = Tween.propHooks[ this.prop ]; - - return hooks && hooks.get ? - hooks.get( this ) : - Tween.propHooks._default.get( this ); - }, - run: function( percent ) { - var eased, - hooks = Tween.propHooks[ this.prop ]; - - if ( this.options.duration ) { - this.pos = eased = jQuery.easing[ this.easing ]( - percent, this.options.duration * percent, 0, 1, this.options.duration - ); - } else { - this.pos = eased = percent; - } - this.now = ( this.end - this.start ) * eased + this.start; - - if ( this.options.step ) { - this.options.step.call( this.elem, this.now, this ); - } - - if ( hooks && hooks.set ) { - hooks.set( this ); - } else { - Tween.propHooks._default.set( this ); - } - return this; - } -}; - -Tween.prototype.init.prototype = Tween.prototype; - -Tween.propHooks = { - _default: { - get: function( tween ) { - var result; - - // Use a property on the element directly when it is not a DOM element, - // or when there is no matching style property that exists. - if ( tween.elem.nodeType !== 1 || - tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { - return tween.elem[ tween.prop ]; - } - - // Passing an empty string as a 3rd parameter to .css will automatically - // attempt a parseFloat and fallback to a string if the parse fails. - // Simple values such as "10px" are parsed to Float; - // complex values such as "rotate(1rad)" are returned as-is. - result = jQuery.css( tween.elem, tween.prop, "" ); - - // Empty strings, null, undefined and "auto" are converted to 0. - return !result || result === "auto" ? 0 : result; - }, - set: function( tween ) { - - // Use step hook for back compat. - // Use cssHook if its there. - // Use .style if available and use plain properties where available. - if ( jQuery.fx.step[ tween.prop ] ) { - jQuery.fx.step[ tween.prop ]( tween ); - } else if ( tween.elem.nodeType === 1 && ( - jQuery.cssHooks[ tween.prop ] || - tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { - jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); - } else { - tween.elem[ tween.prop ] = tween.now; - } - } - } -}; - -// Support: IE <=9 only -// Panic based approach to setting things on disconnected nodes -Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { - set: function( tween ) { - if ( tween.elem.nodeType && tween.elem.parentNode ) { - tween.elem[ tween.prop ] = tween.now; - } - } -}; - -jQuery.easing = { - linear: function( p ) { - return p; - }, - swing: function( p ) { - return 0.5 - Math.cos( p * Math.PI ) / 2; - }, - _default: "swing" -}; - -jQuery.fx = Tween.prototype.init; - -// Back compat <1.8 extension point -jQuery.fx.step = {}; - - - - -var - fxNow, inProgress, - rfxtypes = /^(?:toggle|show|hide)$/, - rrun = /queueHooks$/; - -function schedule() { - if ( inProgress ) { - if ( document.hidden === false && window.requestAnimationFrame ) { - window.requestAnimationFrame( schedule ); - } else { - window.setTimeout( schedule, jQuery.fx.interval ); - } - - jQuery.fx.tick(); - } -} - -// Animations created synchronously will run synchronously -function createFxNow() { - window.setTimeout( function() { - fxNow = undefined; - } ); - return ( fxNow = Date.now() ); -} - -// Generate parameters to create a standard animation -function genFx( type, includeWidth ) { - var which, - i = 0, - attrs = { height: type }; - - // If we include width, step value is 1 to do all cssExpand values, - // otherwise step value is 2 to skip over Left and Right - includeWidth = includeWidth ? 1 : 0; - for ( ; i < 4; i += 2 - includeWidth ) { - which = cssExpand[ i ]; - attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; - } - - if ( includeWidth ) { - attrs.opacity = attrs.width = type; - } - - return attrs; -} - -function createTween( value, prop, animation ) { - var tween, - collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), - index = 0, - length = collection.length; - for ( ; index < length; index++ ) { - if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { - - // We're done with this property - return tween; - } - } -} - -function defaultPrefilter( elem, props, opts ) { - var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, - isBox = "width" in props || "height" in props, - anim = this, - orig = {}, - style = elem.style, - hidden = elem.nodeType && isHiddenWithinTree( elem ), - dataShow = dataPriv.get( elem, "fxshow" ); - - // Queue-skipping animations hijack the fx hooks - if ( !opts.queue ) { - hooks = jQuery._queueHooks( elem, "fx" ); - if ( hooks.unqueued == null ) { - hooks.unqueued = 0; - oldfire = hooks.empty.fire; - hooks.empty.fire = function() { - if ( !hooks.unqueued ) { - oldfire(); - } - }; - } - hooks.unqueued++; - - anim.always( function() { - - // Ensure the complete handler is called before this completes - anim.always( function() { - hooks.unqueued--; - if ( !jQuery.queue( elem, "fx" ).length ) { - hooks.empty.fire(); - } - } ); - } ); - } - - // Detect show/hide animations - for ( prop in props ) { - value = props[ prop ]; - if ( rfxtypes.test( value ) ) { - delete props[ prop ]; - toggle = toggle || value === "toggle"; - if ( value === ( hidden ? "hide" : "show" ) ) { - - // Pretend to be hidden if this is a "show" and - // there is still data from a stopped show/hide - if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { - hidden = true; - - // Ignore all other no-op show/hide data - } else { - continue; - } - } - orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); - } - } - - // Bail out if this is a no-op like .hide().hide() - propTween = !jQuery.isEmptyObject( props ); - if ( !propTween && jQuery.isEmptyObject( orig ) ) { - return; - } - - // Restrict "overflow" and "display" styles during box animations - if ( isBox && elem.nodeType === 1 ) { - - // Support: IE <=9 - 11, Edge 12 - 15 - // Record all 3 overflow attributes because IE does not infer the shorthand - // from identically-valued overflowX and overflowY and Edge just mirrors - // the overflowX value there. - opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; - - // Identify a display type, preferring old show/hide data over the CSS cascade - restoreDisplay = dataShow && dataShow.display; - if ( restoreDisplay == null ) { - restoreDisplay = dataPriv.get( elem, "display" ); - } - display = jQuery.css( elem, "display" ); - if ( display === "none" ) { - if ( restoreDisplay ) { - display = restoreDisplay; - } else { - - // Get nonempty value(s) by temporarily forcing visibility - showHide( [ elem ], true ); - restoreDisplay = elem.style.display || restoreDisplay; - display = jQuery.css( elem, "display" ); - showHide( [ elem ] ); - } - } - - // Animate inline elements as inline-block - if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { - if ( jQuery.css( elem, "float" ) === "none" ) { - - // Restore the original display value at the end of pure show/hide animations - if ( !propTween ) { - anim.done( function() { - style.display = restoreDisplay; - } ); - if ( restoreDisplay == null ) { - display = style.display; - restoreDisplay = display === "none" ? "" : display; - } - } - style.display = "inline-block"; - } - } - } - - if ( opts.overflow ) { - style.overflow = "hidden"; - anim.always( function() { - style.overflow = opts.overflow[ 0 ]; - style.overflowX = opts.overflow[ 1 ]; - style.overflowY = opts.overflow[ 2 ]; - } ); - } - - // Implement show/hide animations - propTween = false; - for ( prop in orig ) { - - // General show/hide setup for this element animation - if ( !propTween ) { - if ( dataShow ) { - if ( "hidden" in dataShow ) { - hidden = dataShow.hidden; - } - } else { - dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); - } - - // Store hidden/visible for toggle so `.stop().toggle()` "reverses" - if ( toggle ) { - dataShow.hidden = !hidden; - } - - // Show elements before animating them - if ( hidden ) { - showHide( [ elem ], true ); - } - - /* eslint-disable no-loop-func */ - - anim.done( function() { - - /* eslint-enable no-loop-func */ - - // The final step of a "hide" animation is actually hiding the element - if ( !hidden ) { - showHide( [ elem ] ); - } - dataPriv.remove( elem, "fxshow" ); - for ( prop in orig ) { - jQuery.style( elem, prop, orig[ prop ] ); - } - } ); - } - - // Per-property setup - propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); - if ( !( prop in dataShow ) ) { - dataShow[ prop ] = propTween.start; - if ( hidden ) { - propTween.end = propTween.start; - propTween.start = 0; - } - } - } -} - -function propFilter( props, specialEasing ) { - var index, name, easing, value, hooks; - - // camelCase, specialEasing and expand cssHook pass - for ( index in props ) { - name = camelCase( index ); - easing = specialEasing[ name ]; - value = props[ index ]; - if ( Array.isArray( value ) ) { - easing = value[ 1 ]; - value = props[ index ] = value[ 0 ]; - } - - if ( index !== name ) { - props[ name ] = value; - delete props[ index ]; - } - - hooks = jQuery.cssHooks[ name ]; - if ( hooks && "expand" in hooks ) { - value = hooks.expand( value ); - delete props[ name ]; - - // Not quite $.extend, this won't overwrite existing keys. - // Reusing 'index' because we have the correct "name" - for ( index in value ) { - if ( !( index in props ) ) { - props[ index ] = value[ index ]; - specialEasing[ index ] = easing; - } - } - } else { - specialEasing[ name ] = easing; - } - } -} - -function Animation( elem, properties, options ) { - var result, - stopped, - index = 0, - length = Animation.prefilters.length, - deferred = jQuery.Deferred().always( function() { - - // Don't match elem in the :animated selector - delete tick.elem; - } ), - tick = function() { - if ( stopped ) { - return false; - } - var currentTime = fxNow || createFxNow(), - remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), - - // Support: Android 2.3 only - // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) - temp = remaining / animation.duration || 0, - percent = 1 - temp, - index = 0, - length = animation.tweens.length; - - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( percent ); - } - - deferred.notifyWith( elem, [ animation, percent, remaining ] ); - - // If there's more to do, yield - if ( percent < 1 && length ) { - return remaining; - } - - // If this was an empty animation, synthesize a final progress notification - if ( !length ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - } - - // Resolve the animation and report its conclusion - deferred.resolveWith( elem, [ animation ] ); - return false; - }, - animation = deferred.promise( { - elem: elem, - props: jQuery.extend( {}, properties ), - opts: jQuery.extend( true, { - specialEasing: {}, - easing: jQuery.easing._default - }, options ), - originalProperties: properties, - originalOptions: options, - startTime: fxNow || createFxNow(), - duration: options.duration, - tweens: [], - createTween: function( prop, end ) { - var tween = jQuery.Tween( elem, animation.opts, prop, end, - animation.opts.specialEasing[ prop ] || animation.opts.easing ); - animation.tweens.push( tween ); - return tween; - }, - stop: function( gotoEnd ) { - var index = 0, - - // If we are going to the end, we want to run all the tweens - // otherwise we skip this part - length = gotoEnd ? animation.tweens.length : 0; - if ( stopped ) { - return this; - } - stopped = true; - for ( ; index < length; index++ ) { - animation.tweens[ index ].run( 1 ); - } - - // Resolve when we played the last frame; otherwise, reject - if ( gotoEnd ) { - deferred.notifyWith( elem, [ animation, 1, 0 ] ); - deferred.resolveWith( elem, [ animation, gotoEnd ] ); - } else { - deferred.rejectWith( elem, [ animation, gotoEnd ] ); - } - return this; - } - } ), - props = animation.props; - - propFilter( props, animation.opts.specialEasing ); - - for ( ; index < length; index++ ) { - result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); - if ( result ) { - if ( isFunction( result.stop ) ) { - jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = - result.stop.bind( result ); - } - return result; - } - } - - jQuery.map( props, createTween, animation ); - - if ( isFunction( animation.opts.start ) ) { - animation.opts.start.call( elem, animation ); - } - - // Attach callbacks from options - animation - .progress( animation.opts.progress ) - .done( animation.opts.done, animation.opts.complete ) - .fail( animation.opts.fail ) - .always( animation.opts.always ); - - jQuery.fx.timer( - jQuery.extend( tick, { - elem: elem, - anim: animation, - queue: animation.opts.queue - } ) - ); - - return animation; -} - -jQuery.Animation = jQuery.extend( Animation, { - - tweeners: { - "*": [ function( prop, value ) { - var tween = this.createTween( prop, value ); - adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); - return tween; - } ] - }, - - tweener: function( props, callback ) { - if ( isFunction( props ) ) { - callback = props; - props = [ "*" ]; - } else { - props = props.match( rnothtmlwhite ); - } - - var prop, - index = 0, - length = props.length; - - for ( ; index < length; index++ ) { - prop = props[ index ]; - Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; - Animation.tweeners[ prop ].unshift( callback ); - } - }, - - prefilters: [ defaultPrefilter ], - - prefilter: function( callback, prepend ) { - if ( prepend ) { - Animation.prefilters.unshift( callback ); - } else { - Animation.prefilters.push( callback ); - } - } -} ); - -jQuery.speed = function( speed, easing, fn ) { - var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { - complete: fn || !fn && easing || - isFunction( speed ) && speed, - duration: speed, - easing: fn && easing || easing && !isFunction( easing ) && easing - }; - - // Go to the end state if fx are off - if ( jQuery.fx.off ) { - opt.duration = 0; - - } else { - if ( typeof opt.duration !== "number" ) { - if ( opt.duration in jQuery.fx.speeds ) { - opt.duration = jQuery.fx.speeds[ opt.duration ]; - - } else { - opt.duration = jQuery.fx.speeds._default; - } - } - } - - // Normalize opt.queue - true/undefined/null -> "fx" - if ( opt.queue == null || opt.queue === true ) { - opt.queue = "fx"; - } - - // Queueing - opt.old = opt.complete; - - opt.complete = function() { - if ( isFunction( opt.old ) ) { - opt.old.call( this ); - } - - if ( opt.queue ) { - jQuery.dequeue( this, opt.queue ); - } - }; - - return opt; -}; - -jQuery.fn.extend( { - fadeTo: function( speed, to, easing, callback ) { - - // Show any hidden elements after setting opacity to 0 - return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() - - // Animate to the value specified - .end().animate( { opacity: to }, speed, easing, callback ); - }, - animate: function( prop, speed, easing, callback ) { - var empty = jQuery.isEmptyObject( prop ), - optall = jQuery.speed( speed, easing, callback ), - doAnimation = function() { - - // Operate on a copy of prop so per-property easing won't be lost - var anim = Animation( this, jQuery.extend( {}, prop ), optall ); - - // Empty animations, or finishing resolves immediately - if ( empty || dataPriv.get( this, "finish" ) ) { - anim.stop( true ); - } - }; - - doAnimation.finish = doAnimation; - - return empty || optall.queue === false ? - this.each( doAnimation ) : - this.queue( optall.queue, doAnimation ); - }, - stop: function( type, clearQueue, gotoEnd ) { - var stopQueue = function( hooks ) { - var stop = hooks.stop; - delete hooks.stop; - stop( gotoEnd ); - }; - - if ( typeof type !== "string" ) { - gotoEnd = clearQueue; - clearQueue = type; - type = undefined; - } - if ( clearQueue ) { - this.queue( type || "fx", [] ); - } - - return this.each( function() { - var dequeue = true, - index = type != null && type + "queueHooks", - timers = jQuery.timers, - data = dataPriv.get( this ); - - if ( index ) { - if ( data[ index ] && data[ index ].stop ) { - stopQueue( data[ index ] ); - } - } else { - for ( index in data ) { - if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { - stopQueue( data[ index ] ); - } - } - } - - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && - ( type == null || timers[ index ].queue === type ) ) { - - timers[ index ].anim.stop( gotoEnd ); - dequeue = false; - timers.splice( index, 1 ); - } - } - - // Start the next in the queue if the last step wasn't forced. - // Timers currently will call their complete callbacks, which - // will dequeue but only if they were gotoEnd. - if ( dequeue || !gotoEnd ) { - jQuery.dequeue( this, type ); - } - } ); - }, - finish: function( type ) { - if ( type !== false ) { - type = type || "fx"; - } - return this.each( function() { - var index, - data = dataPriv.get( this ), - queue = data[ type + "queue" ], - hooks = data[ type + "queueHooks" ], - timers = jQuery.timers, - length = queue ? queue.length : 0; - - // Enable finishing flag on private data - data.finish = true; - - // Empty the queue first - jQuery.queue( this, type, [] ); - - if ( hooks && hooks.stop ) { - hooks.stop.call( this, true ); - } - - // Look for any active animations, and finish them - for ( index = timers.length; index--; ) { - if ( timers[ index ].elem === this && timers[ index ].queue === type ) { - timers[ index ].anim.stop( true ); - timers.splice( index, 1 ); - } - } - - // Look for any animations in the old queue and finish them - for ( index = 0; index < length; index++ ) { - if ( queue[ index ] && queue[ index ].finish ) { - queue[ index ].finish.call( this ); - } - } - - // Turn off finishing flag - delete data.finish; - } ); - } -} ); - -jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { - var cssFn = jQuery.fn[ name ]; - jQuery.fn[ name ] = function( speed, easing, callback ) { - return speed == null || typeof speed === "boolean" ? - cssFn.apply( this, arguments ) : - this.animate( genFx( name, true ), speed, easing, callback ); - }; -} ); - -// Generate shortcuts for custom animations -jQuery.each( { - slideDown: genFx( "show" ), - slideUp: genFx( "hide" ), - slideToggle: genFx( "toggle" ), - fadeIn: { opacity: "show" }, - fadeOut: { opacity: "hide" }, - fadeToggle: { opacity: "toggle" } -}, function( name, props ) { - jQuery.fn[ name ] = function( speed, easing, callback ) { - return this.animate( props, speed, easing, callback ); - }; -} ); - -jQuery.timers = []; -jQuery.fx.tick = function() { - var timer, - i = 0, - timers = jQuery.timers; - - fxNow = Date.now(); - - for ( ; i < timers.length; i++ ) { - timer = timers[ i ]; - - // Run the timer and safely remove it when done (allowing for external removal) - if ( !timer() && timers[ i ] === timer ) { - timers.splice( i--, 1 ); - } - } - - if ( !timers.length ) { - jQuery.fx.stop(); - } - fxNow = undefined; -}; - -jQuery.fx.timer = function( timer ) { - jQuery.timers.push( timer ); - jQuery.fx.start(); -}; - -jQuery.fx.interval = 13; -jQuery.fx.start = function() { - if ( inProgress ) { - return; - } - - inProgress = true; - schedule(); -}; - -jQuery.fx.stop = function() { - inProgress = null; -}; - -jQuery.fx.speeds = { - slow: 600, - fast: 200, - - // Default speed - _default: 400 -}; - - -// Based off of the plugin by Clint Helfers, with permission. -// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ -jQuery.fn.delay = function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = window.setTimeout( next, time ); - hooks.stop = function() { - window.clearTimeout( timeout ); - }; - } ); -}; - - -( function() { - var input = document.createElement( "input" ), - select = document.createElement( "select" ), - opt = select.appendChild( document.createElement( "option" ) ); - - input.type = "checkbox"; - - // Support: Android <=4.3 only - // Default value for a checkbox should be "on" - support.checkOn = input.value !== ""; - - // Support: IE <=11 only - // Must access selectedIndex to make default options select - support.optSelected = opt.selected; - - // Support: IE <=11 only - // An input loses its value after becoming a radio - input = document.createElement( "input" ); - input.value = "t"; - input.type = "radio"; - support.radioValue = input.value === "t"; -} )(); - - -var boolHook, - attrHandle = jQuery.expr.attrHandle; - -jQuery.fn.extend( { - attr: function( name, value ) { - return access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each( function() { - jQuery.removeAttr( this, name ); - } ); - } -} ); - -jQuery.extend( { - attr: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set attributes on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === "undefined" ) { - return jQuery.prop( elem, name, value ); - } - - // Attribute hooks are determined by the lowercase version - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - hooks = jQuery.attrHooks[ name.toLowerCase() ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); - } - - if ( value !== undefined ) { - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return; - } - - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - elem.setAttribute( name, value + "" ); - return value; - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? undefined : ret; - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !support.radioValue && value === "radio" && - nodeName( elem, "input" ) ) { - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - removeAttr: function( elem, value ) { - var name, - i = 0, - - // Attribute names can contain non-HTML whitespace characters - // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 - attrNames = value && value.match( rnothtmlwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( ( name = attrNames[ i++ ] ) ) { - elem.removeAttribute( name ); - } - } - } -} ); - -// Hooks for boolean attributes -boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - elem.setAttribute( name, name ); - } - return name; - } -}; - -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { - var getter = attrHandle[ name ] || jQuery.find.attr; - - attrHandle[ name ] = function( elem, name, isXML ) { - var ret, handle, - lowercaseName = name.toLowerCase(); - - if ( !isXML ) { - - // Avoid an infinite loop by temporarily removing this function from the getter - handle = attrHandle[ lowercaseName ]; - attrHandle[ lowercaseName ] = ret; - ret = getter( elem, name, isXML ) != null ? - lowercaseName : - null; - attrHandle[ lowercaseName ] = handle; - } - return ret; - }; -} ); - - - - -var rfocusable = /^(?:input|select|textarea|button)$/i, - rclickable = /^(?:a|area)$/i; - -jQuery.fn.extend( { - prop: function( name, value ) { - return access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - return this.each( function() { - delete this[ jQuery.propFix[ name ] || name ]; - } ); - } -} ); - -jQuery.extend( { - prop: function( elem, name, value ) { - var ret, hooks, - nType = elem.nodeType; - - // Don't get/set properties on text, comment and attribute nodes - if ( nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && - ( ret = hooks.set( elem, value, name ) ) !== undefined ) { - return ret; - } - - return ( elem[ name ] = value ); - } - - if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { - return ret; - } - - return elem[ name ]; - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - - // Support: IE <=9 - 11 only - // elem.tabIndex doesn't always return the - // correct value when it hasn't been explicitly set - // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - // Use proper attribute retrieval(#12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - if ( tabindex ) { - return parseInt( tabindex, 10 ); - } - - if ( - rfocusable.test( elem.nodeName ) || - rclickable.test( elem.nodeName ) && - elem.href - ) { - return 0; - } - - return -1; - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - } -} ); - -// Support: IE <=11 only -// Accessing the selectedIndex property -// forces the browser to respect setting selected -// on the option -// The getter ensures a default option is selected -// when in an optgroup -// eslint rule "no-unused-expressions" is disabled for this code -// since it considers such accessions noop -if ( !support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent && parent.parentNode ) { - parent.parentNode.selectedIndex; - } - return null; - }, - set: function( elem ) { - - /* eslint no-unused-expressions: "off" */ - - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - }; -} - -jQuery.each( [ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" -], function() { - jQuery.propFix[ this.toLowerCase() ] = this; -} ); - - - - - // Strip and collapse whitespace according to HTML spec - // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace - function stripAndCollapse( value ) { - var tokens = value.match( rnothtmlwhite ) || []; - return tokens.join( " " ); - } - - -function getClass( elem ) { - return elem.getAttribute && elem.getAttribute( "class" ) || ""; -} - -function classesToArray( value ) { - if ( Array.isArray( value ) ) { - return value; - } - if ( typeof value === "string" ) { - return value.match( rnothtmlwhite ) || []; - } - return []; -} - -jQuery.fn.extend( { - addClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, curValue, clazz, j, finalValue, - i = 0; - - if ( isFunction( value ) ) { - return this.each( function( j ) { - jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); - } ); - } - - if ( !arguments.length ) { - return this.attr( "class", "" ); - } - - classes = classesToArray( value ); - - if ( classes.length ) { - while ( ( elem = this[ i++ ] ) ) { - curValue = getClass( elem ); - - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); - - if ( cur ) { - j = 0; - while ( ( clazz = classes[ j++ ] ) ) { - - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) > -1 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - - // Only assign if different to avoid unneeded rendering. - finalValue = stripAndCollapse( cur ); - if ( curValue !== finalValue ) { - elem.setAttribute( "class", finalValue ); - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isValidValue = type === "string" || Array.isArray( value ); - - if ( typeof stateVal === "boolean" && isValidValue ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - if ( isFunction( value ) ) { - return this.each( function( i ) { - jQuery( this ).toggleClass( - value.call( this, i, getClass( this ), stateVal ), - stateVal - ); - } ); - } - - return this.each( function() { - var className, i, self, classNames; - - if ( isValidValue ) { - - // Toggle individual class names - i = 0; - self = jQuery( this ); - classNames = classesToArray( value ); - - while ( ( className = classNames[ i++ ] ) ) { - - // Check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( value === undefined || type === "boolean" ) { - className = getClass( this ); - if ( className ) { - - // Store className if set - dataPriv.set( this, "__className__", className ); - } - - // If the element has a class name or if we're passed `false`, - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - if ( this.setAttribute ) { - this.setAttribute( "class", - className || value === false ? - "" : - dataPriv.get( this, "__className__" ) || "" - ); - } - } - } ); - }, - - hasClass: function( selector ) { - var className, elem, - i = 0; - - className = " " + selector + " "; - while ( ( elem = this[ i++ ] ) ) { - if ( elem.nodeType === 1 && - ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { - return true; - } - } - - return false; - } -} ); - - - - -var rreturn = /\r/g; - -jQuery.fn.extend( { - val: function( value ) { - var hooks, ret, valueIsFunction, - elem = this[ 0 ]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || - jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && - "get" in hooks && - ( ret = hooks.get( elem, "value" ) ) !== undefined - ) { - return ret; - } - - ret = elem.value; - - // Handle most common string cases - if ( typeof ret === "string" ) { - return ret.replace( rreturn, "" ); - } - - // Handle cases where value is null/undef or number - return ret == null ? "" : ret; - } - - return; - } - - valueIsFunction = isFunction( value ); - - return this.each( function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( valueIsFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - - } else if ( typeof val === "number" ) { - val += ""; - - } else if ( Array.isArray( val ) ) { - val = jQuery.map( val, function( value ) { - return value == null ? "" : value + ""; - } ); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - } ); - } -} ); - -jQuery.extend( { - valHooks: { - option: { - get: function( elem ) { - - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - - // Support: IE <=10 - 11 only - // option.text throws exceptions (#14686, #14858) - // Strip and collapse whitespace - // https://html.spec.whatwg.org/#strip-and-collapse-whitespace - stripAndCollapse( jQuery.text( elem ) ); - } - }, - select: { - get: function( elem ) { - var value, option, i, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one", - values = one ? null : [], - max = one ? index + 1 : options.length; - - if ( index < 0 ) { - i = max; - - } else { - i = one ? index : 0; - } - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Support: IE <=9 only - // IE8-9 doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - - // Don't return options that are disabled or in a disabled optgroup - !option.disabled && - ( !option.parentNode.disabled || - !nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - - /* eslint-disable no-cond-assign */ - - if ( option.selected = - jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 - ) { - optionSet = true; - } - - /* eslint-enable no-cond-assign */ - } - - // Force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - } -} ); - -// Radios and checkboxes getter/setter -jQuery.each( [ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( Array.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); - } - } - }; - if ( !support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - return elem.getAttribute( "value" ) === null ? "on" : elem.value; - }; - } -} ); - - - - -// Return jQuery for attributes-only inclusion - - -support.focusin = "onfocusin" in window; - - -var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - stopPropagationCallback = function( e ) { - e.stopPropagation(); - }; - -jQuery.extend( jQuery.event, { - - trigger: function( event, data, elem, onlyHandlers ) { - - var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; - - cur = lastElement = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf( "." ) > -1 ) { - - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split( "." ); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf( ":" ) < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join( "." ); - event.rnamespace = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === ( elem.ownerDocument || document ) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { - lastElement = cur; - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && - dataPriv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( ( !special._default || - special._default.apply( eventPath.pop(), data ) === false ) && - acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - - if ( event.isPropagationStopped() ) { - lastElement.addEventListener( type, stopPropagationCallback ); - } - - elem[ type ](); - - if ( event.isPropagationStopped() ) { - lastElement.removeEventListener( type, stopPropagationCallback ); - } - - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - // Piggyback on a donor event to simulate a different one - // Used only for `focus(in | out)` events - simulate: function( type, elem, event ) { - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true - } - ); - - jQuery.event.trigger( e, null, elem ); - } - -} ); - -jQuery.fn.extend( { - - trigger: function( type, data ) { - return this.each( function() { - jQuery.event.trigger( type, data, this ); - } ); - }, - triggerHandler: function( type, data ) { - var elem = this[ 0 ]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -} ); - - -// Support: Firefox <=44 -// Firefox doesn't have focus(in | out) events -// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 -// -// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 -// focus(in | out) events fire after focus & blur events, -// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order -// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 -if ( !support.focusin ) { - jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - - // Handle: regular nodes (via `this.ownerDocument`), window - // (via `this.document`) & document (via `this`). - var doc = this.ownerDocument || this.document || this, - attaches = dataPriv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this.document || this, - attaches = dataPriv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - dataPriv.remove( doc, fix ); - - } else { - dataPriv.access( doc, fix, attaches ); - } - } - }; - } ); -} -var location = window.location; - -var nonce = { guid: Date.now() }; - -var rquery = ( /\?/ ); - - - -// Cross-browser xml parsing -jQuery.parseXML = function( data ) { - var xml, parserErrorElem; - if ( !data || typeof data !== "string" ) { - return null; - } - - // Support: IE 9 - 11 only - // IE throws on parseFromString with invalid input. - try { - xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); - } catch ( e ) {} - - parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; - if ( !xml || parserErrorElem ) { - jQuery.error( "Invalid XML: " + ( - parserErrorElem ? - jQuery.map( parserErrorElem.childNodes, function( el ) { - return el.textContent; - } ).join( "\n" ) : - data - ) ); - } - return xml; -}; - - -var - rbracket = /\[\]$/, - rCRLF = /\r?\n/g, - rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, - rsubmittable = /^(?:input|select|textarea|keygen)/i; - -function buildParams( prefix, obj, traditional, add ) { - var name; - - if ( Array.isArray( obj ) ) { - - // Serialize array item. - jQuery.each( obj, function( i, v ) { - if ( traditional || rbracket.test( prefix ) ) { - - // Treat each array item as a scalar. - add( prefix, v ); - - } else { - - // Item is non-scalar (array or object), encode its numeric index. - buildParams( - prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", - v, - traditional, - add - ); - } - } ); - - } else if ( !traditional && toType( obj ) === "object" ) { - - // Serialize object item. - for ( name in obj ) { - buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); - } - - } else { - - // Serialize scalar item. - add( prefix, obj ); - } -} - -// Serialize an array of form elements or a set of -// key/values into a query string -jQuery.param = function( a, traditional ) { - var prefix, - s = [], - add = function( key, valueOrFunction ) { - - // If value is a function, invoke it and use its return value - var value = isFunction( valueOrFunction ) ? - valueOrFunction() : - valueOrFunction; - - s[ s.length ] = encodeURIComponent( key ) + "=" + - encodeURIComponent( value == null ? "" : value ); - }; - - if ( a == null ) { - return ""; - } - - // If an array was passed in, assume that it is an array of form elements. - if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { - - // Serialize the form elements - jQuery.each( a, function() { - add( this.name, this.value ); - } ); - - } else { - - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for ( prefix in a ) { - buildParams( prefix, a[ prefix ], traditional, add ); - } - } - - // Return the resulting serialization - return s.join( "&" ); -}; - -jQuery.fn.extend( { - serialize: function() { - return jQuery.param( this.serializeArray() ); - }, - serializeArray: function() { - return this.map( function() { - - // Can add propHook for "elements" to filter or add form elements - var elements = jQuery.prop( this, "elements" ); - return elements ? jQuery.makeArray( elements ) : this; - } ).filter( function() { - var type = this.type; - - // Use .is( ":disabled" ) so that fieldset[disabled] works - return this.name && !jQuery( this ).is( ":disabled" ) && - rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && - ( this.checked || !rcheckableType.test( type ) ); - } ).map( function( _i, elem ) { - var val = jQuery( this ).val(); - - if ( val == null ) { - return null; - } - - if ( Array.isArray( val ) ) { - return jQuery.map( val, function( val ) { - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ); - } - - return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; - } ).get(); - } -} ); - - -var - r20 = /%20/g, - rhash = /#.*$/, - rantiCache = /([?&])_=[^&]*/, - rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, - - // #7653, #8125, #8152: local protocol detection - rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, - rnoContent = /^(?:GET|HEAD)$/, - rprotocol = /^\/\//, - - /* Prefilters - * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) - * 2) These are called: - * - BEFORE asking for a transport - * - AFTER param serialization (s.data is a string if s.processData is true) - * 3) key is the dataType - * 4) the catchall symbol "*" can be used - * 5) execution will start with transport dataType and THEN continue down to "*" if needed - */ - prefilters = {}, - - /* Transports bindings - * 1) key is the dataType - * 2) the catchall symbol "*" can be used - * 3) selection will start with transport dataType and THEN go to "*" if needed - */ - transports = {}, - - // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression - allTypes = "*/".concat( "*" ), - - // Anchor tag for parsing the document origin - originAnchor = document.createElement( "a" ); - -originAnchor.href = location.href; - -// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport -function addToPrefiltersOrTransports( structure ) { - - // dataTypeExpression is optional and defaults to "*" - return function( dataTypeExpression, func ) { - - if ( typeof dataTypeExpression !== "string" ) { - func = dataTypeExpression; - dataTypeExpression = "*"; - } - - var dataType, - i = 0, - dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; - - if ( isFunction( func ) ) { - - // For each dataType in the dataTypeExpression - while ( ( dataType = dataTypes[ i++ ] ) ) { - - // Prepend if requested - if ( dataType[ 0 ] === "+" ) { - dataType = dataType.slice( 1 ) || "*"; - ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); - - // Otherwise append - } else { - ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); - } - } - } - }; -} - -// Base inspection function for prefilters and transports -function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { - - var inspected = {}, - seekingTransport = ( structure === transports ); - - function inspect( dataType ) { - var selected; - inspected[ dataType ] = true; - jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { - var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); - if ( typeof dataTypeOrTransport === "string" && - !seekingTransport && !inspected[ dataTypeOrTransport ] ) { - - options.dataTypes.unshift( dataTypeOrTransport ); - inspect( dataTypeOrTransport ); - return false; - } else if ( seekingTransport ) { - return !( selected = dataTypeOrTransport ); - } - } ); - return selected; - } - - return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); -} - -// A special extend for ajax options -// that takes "flat" options (not to be deep extended) -// Fixes #9887 -function ajaxExtend( target, src ) { - var key, deep, - flatOptions = jQuery.ajaxSettings.flatOptions || {}; - - for ( key in src ) { - if ( src[ key ] !== undefined ) { - ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; - } - } - if ( deep ) { - jQuery.extend( true, target, deep ); - } - - return target; -} - -/* Handles responses to an ajax request: - * - finds the right dataType (mediates between content-type and expected dataType) - * - returns the corresponding response - */ -function ajaxHandleResponses( s, jqXHR, responses ) { - - var ct, type, finalDataType, firstDataType, - contents = s.contents, - dataTypes = s.dataTypes; - - // Remove auto dataType and get content-type in the process - while ( dataTypes[ 0 ] === "*" ) { - dataTypes.shift(); - if ( ct === undefined ) { - ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); - } - } - - // Check if we're dealing with a known content-type - if ( ct ) { - for ( type in contents ) { - if ( contents[ type ] && contents[ type ].test( ct ) ) { - dataTypes.unshift( type ); - break; - } - } - } - - // Check to see if we have a response for the expected dataType - if ( dataTypes[ 0 ] in responses ) { - finalDataType = dataTypes[ 0 ]; - } else { - - // Try convertible dataTypes - for ( type in responses ) { - if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { - finalDataType = type; - break; - } - if ( !firstDataType ) { - firstDataType = type; - } - } - - // Or just use first one - finalDataType = finalDataType || firstDataType; - } - - // If we found a dataType - // We add the dataType to the list if needed - // and return the corresponding response - if ( finalDataType ) { - if ( finalDataType !== dataTypes[ 0 ] ) { - dataTypes.unshift( finalDataType ); - } - return responses[ finalDataType ]; - } -} - -/* Chain conversions given the request and the original response - * Also sets the responseXXX fields on the jqXHR instance - */ -function ajaxConvert( s, response, jqXHR, isSuccess ) { - var conv2, current, conv, tmp, prev, - converters = {}, - - // Work with a copy of dataTypes in case we need to modify it for conversion - dataTypes = s.dataTypes.slice(); - - // Create converters map with lowercased keys - if ( dataTypes[ 1 ] ) { - for ( conv in s.converters ) { - converters[ conv.toLowerCase() ] = s.converters[ conv ]; - } - } - - current = dataTypes.shift(); - - // Convert to each sequential dataType - while ( current ) { - - if ( s.responseFields[ current ] ) { - jqXHR[ s.responseFields[ current ] ] = response; - } - - // Apply the dataFilter if provided - if ( !prev && isSuccess && s.dataFilter ) { - response = s.dataFilter( response, s.dataType ); - } - - prev = current; - current = dataTypes.shift(); - - if ( current ) { - - // There's only work to do if current dataType is non-auto - if ( current === "*" ) { - - current = prev; - - // Convert response if prev dataType is non-auto and differs from current - } else if ( prev !== "*" && prev !== current ) { - - // Seek a direct converter - conv = converters[ prev + " " + current ] || converters[ "* " + current ]; - - // If none found, seek a pair - if ( !conv ) { - for ( conv2 in converters ) { - - // If conv2 outputs current - tmp = conv2.split( " " ); - if ( tmp[ 1 ] === current ) { - - // If prev can be converted to accepted input - conv = converters[ prev + " " + tmp[ 0 ] ] || - converters[ "* " + tmp[ 0 ] ]; - if ( conv ) { - - // Condense equivalence converters - if ( conv === true ) { - conv = converters[ conv2 ]; - - // Otherwise, insert the intermediate dataType - } else if ( converters[ conv2 ] !== true ) { - current = tmp[ 0 ]; - dataTypes.unshift( tmp[ 1 ] ); - } - break; - } - } - } - } - - // Apply converter (if not an equivalence) - if ( conv !== true ) { - - // Unless errors are allowed to bubble, catch and return them - if ( conv && s.throws ) { - response = conv( response ); - } else { - try { - response = conv( response ); - } catch ( e ) { - return { - state: "parsererror", - error: conv ? e : "No conversion from " + prev + " to " + current - }; - } - } - } - } - } - } - - return { state: "success", data: response }; -} - -jQuery.extend( { - - // Counter for holding the number of active queries - active: 0, - - // Last-Modified header cache for next request - lastModified: {}, - etag: {}, - - ajaxSettings: { - url: location.href, - type: "GET", - isLocal: rlocalProtocol.test( location.protocol ), - global: true, - processData: true, - async: true, - contentType: "application/x-www-form-urlencoded; charset=UTF-8", - - /* - timeout: 0, - data: null, - dataType: null, - username: null, - password: null, - cache: null, - throws: false, - traditional: false, - headers: {}, - */ - - accepts: { - "*": allTypes, - text: "text/plain", - html: "text/html", - xml: "application/xml, text/xml", - json: "application/json, text/javascript" - }, - - contents: { - xml: /\bxml\b/, - html: /\bhtml/, - json: /\bjson\b/ - }, - - responseFields: { - xml: "responseXML", - text: "responseText", - json: "responseJSON" - }, - - // Data converters - // Keys separate source (or catchall "*") and destination types with a single space - converters: { - - // Convert anything to text - "* text": String, - - // Text to html (true = no transformation) - "text html": true, - - // Evaluate text as a json expression - "text json": JSON.parse, - - // Parse text as xml - "text xml": jQuery.parseXML - }, - - // For options that shouldn't be deep extended: - // you can add your own custom options here if - // and when you create one that shouldn't be - // deep extended (see ajaxExtend) - flatOptions: { - url: true, - context: true - } - }, - - // Creates a full fledged settings object into target - // with both ajaxSettings and settings fields. - // If target is omitted, writes into ajaxSettings. - ajaxSetup: function( target, settings ) { - return settings ? - - // Building a settings object - ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : - - // Extending ajaxSettings - ajaxExtend( jQuery.ajaxSettings, target ); - }, - - ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), - ajaxTransport: addToPrefiltersOrTransports( transports ), - - // Main method - ajax: function( url, options ) { - - // If url is an object, simulate pre-1.5 signature - if ( typeof url === "object" ) { - options = url; - url = undefined; - } - - // Force options to be an object - options = options || {}; - - var transport, - - // URL without anti-cache param - cacheURL, - - // Response headers - responseHeadersString, - responseHeaders, - - // timeout handle - timeoutTimer, - - // Url cleanup var - urlAnchor, - - // Request state (becomes false upon send and true upon completion) - completed, - - // To know if global events are to be dispatched - fireGlobals, - - // Loop variable - i, - - // uncached part of the url - uncached, - - // Create the final options object - s = jQuery.ajaxSetup( {}, options ), - - // Callbacks context - callbackContext = s.context || s, - - // Context for global events is callbackContext if it is a DOM node or jQuery collection - globalEventContext = s.context && - ( callbackContext.nodeType || callbackContext.jquery ) ? - jQuery( callbackContext ) : - jQuery.event, - - // Deferreds - deferred = jQuery.Deferred(), - completeDeferred = jQuery.Callbacks( "once memory" ), - - // Status-dependent callbacks - statusCode = s.statusCode || {}, - - // Headers (they are sent all at once) - requestHeaders = {}, - requestHeadersNames = {}, - - // Default abort message - strAbort = "canceled", - - // Fake xhr - jqXHR = { - readyState: 0, - - // Builds headers hashtable if needed - getResponseHeader: function( key ) { - var match; - if ( completed ) { - if ( !responseHeaders ) { - responseHeaders = {}; - while ( ( match = rheaders.exec( responseHeadersString ) ) ) { - responseHeaders[ match[ 1 ].toLowerCase() + " " ] = - ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) - .concat( match[ 2 ] ); - } - } - match = responseHeaders[ key.toLowerCase() + " " ]; - } - return match == null ? null : match.join( ", " ); - }, - - // Raw string - getAllResponseHeaders: function() { - return completed ? responseHeadersString : null; - }, - - // Caches the header - setRequestHeader: function( name, value ) { - if ( completed == null ) { - name = requestHeadersNames[ name.toLowerCase() ] = - requestHeadersNames[ name.toLowerCase() ] || name; - requestHeaders[ name ] = value; - } - return this; - }, - - // Overrides response content-type header - overrideMimeType: function( type ) { - if ( completed == null ) { - s.mimeType = type; - } - return this; - }, - - // Status-dependent callbacks - statusCode: function( map ) { - var code; - if ( map ) { - if ( completed ) { - - // Execute the appropriate callbacks - jqXHR.always( map[ jqXHR.status ] ); - } else { - - // Lazy-add the new callbacks in a way that preserves old ones - for ( code in map ) { - statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; - } - } - } - return this; - }, - - // Cancel the request - abort: function( statusText ) { - var finalText = statusText || strAbort; - if ( transport ) { - transport.abort( finalText ); - } - done( 0, finalText ); - return this; - } - }; - - // Attach deferreds - deferred.promise( jqXHR ); - - // Add protocol if not provided (prefilters might expect it) - // Handle falsy url in the settings object (#10093: consistency with old signature) - // We also use the url parameter if available - s.url = ( ( url || s.url || location.href ) + "" ) - .replace( rprotocol, location.protocol + "//" ); - - // Alias method option to type as per ticket #12004 - s.type = options.method || options.type || s.method || s.type; - - // Extract dataTypes list - s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; - - // A cross-domain request is in order when the origin doesn't match the current origin. - if ( s.crossDomain == null ) { - urlAnchor = document.createElement( "a" ); - - // Support: IE <=8 - 11, Edge 12 - 15 - // IE throws exception on accessing the href property if url is malformed, - // e.g. http://example.com:80x/ - try { - urlAnchor.href = s.url; - - // Support: IE <=8 - 11 only - // Anchor's host property isn't correctly set when s.url is relative - urlAnchor.href = urlAnchor.href; - s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== - urlAnchor.protocol + "//" + urlAnchor.host; - } catch ( e ) { - - // If there is an error parsing the URL, assume it is crossDomain, - // it can be rejected by the transport if it is invalid - s.crossDomain = true; - } - } - - // Convert data if not already a string - if ( s.data && s.processData && typeof s.data !== "string" ) { - s.data = jQuery.param( s.data, s.traditional ); - } - - // Apply prefilters - inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); - - // If request was aborted inside a prefilter, stop there - if ( completed ) { - return jqXHR; - } - - // We can fire global events as of now if asked to - // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) - fireGlobals = jQuery.event && s.global; - - // Watch for a new set of requests - if ( fireGlobals && jQuery.active++ === 0 ) { - jQuery.event.trigger( "ajaxStart" ); - } - - // Uppercase the type - s.type = s.type.toUpperCase(); - - // Determine if request has content - s.hasContent = !rnoContent.test( s.type ); - - // Save the URL in case we're toying with the If-Modified-Since - // and/or If-None-Match header later on - // Remove hash to simplify url manipulation - cacheURL = s.url.replace( rhash, "" ); - - // More options handling for requests with no content - if ( !s.hasContent ) { - - // Remember the hash so we can put it back - uncached = s.url.slice( cacheURL.length ); - - // If data is available and should be processed, append data to url - if ( s.data && ( s.processData || typeof s.data === "string" ) ) { - cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; - - // #9682: remove data so that it's not used in an eventual retry - delete s.data; - } - - // Add or update anti-cache param if needed - if ( s.cache === false ) { - cacheURL = cacheURL.replace( rantiCache, "$1" ); - uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + - uncached; - } - - // Put hash and anti-cache on the URL that will be requested (gh-1732) - s.url = cacheURL + uncached; - - // Change '%20' to '+' if this is encoded form body content (gh-2658) - } else if ( s.data && s.processData && - ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { - s.data = s.data.replace( r20, "+" ); - } - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - if ( jQuery.lastModified[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); - } - if ( jQuery.etag[ cacheURL ] ) { - jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); - } - } - - // Set the correct header, if data is being sent - if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { - jqXHR.setRequestHeader( "Content-Type", s.contentType ); - } - - // Set the Accepts header for the server, depending on the dataType - jqXHR.setRequestHeader( - "Accept", - s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? - s.accepts[ s.dataTypes[ 0 ] ] + - ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : - s.accepts[ "*" ] - ); - - // Check for headers option - for ( i in s.headers ) { - jqXHR.setRequestHeader( i, s.headers[ i ] ); - } - - // Allow custom headers/mimetypes and early abort - if ( s.beforeSend && - ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { - - // Abort if not done already and return - return jqXHR.abort(); - } - - // Aborting is no longer a cancellation - strAbort = "abort"; - - // Install callbacks on deferreds - completeDeferred.add( s.complete ); - jqXHR.done( s.success ); - jqXHR.fail( s.error ); - - // Get transport - transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); - - // If no transport, we auto-abort - if ( !transport ) { - done( -1, "No Transport" ); - } else { - jqXHR.readyState = 1; - - // Send global event - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); - } - - // If request was aborted inside ajaxSend, stop there - if ( completed ) { - return jqXHR; - } - - // Timeout - if ( s.async && s.timeout > 0 ) { - timeoutTimer = window.setTimeout( function() { - jqXHR.abort( "timeout" ); - }, s.timeout ); - } - - try { - completed = false; - transport.send( requestHeaders, done ); - } catch ( e ) { - - // Rethrow post-completion exceptions - if ( completed ) { - throw e; - } - - // Propagate others as results - done( -1, e ); - } - } - - // Callback for when everything is done - function done( status, nativeStatusText, responses, headers ) { - var isSuccess, success, error, response, modified, - statusText = nativeStatusText; - - // Ignore repeat invocations - if ( completed ) { - return; - } - - completed = true; - - // Clear timeout if it exists - if ( timeoutTimer ) { - window.clearTimeout( timeoutTimer ); - } - - // Dereference transport for early garbage collection - // (no matter how long the jqXHR object will be used) - transport = undefined; - - // Cache response headers - responseHeadersString = headers || ""; - - // Set readyState - jqXHR.readyState = status > 0 ? 4 : 0; - - // Determine if successful - isSuccess = status >= 200 && status < 300 || status === 304; - - // Get response data - if ( responses ) { - response = ajaxHandleResponses( s, jqXHR, responses ); - } - - // Use a noop converter for missing script but not if jsonp - if ( !isSuccess && - jQuery.inArray( "script", s.dataTypes ) > -1 && - jQuery.inArray( "json", s.dataTypes ) < 0 ) { - s.converters[ "text script" ] = function() {}; - } - - // Convert no matter what (that way responseXXX fields are always set) - response = ajaxConvert( s, response, jqXHR, isSuccess ); - - // If successful, handle type chaining - if ( isSuccess ) { - - // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. - if ( s.ifModified ) { - modified = jqXHR.getResponseHeader( "Last-Modified" ); - if ( modified ) { - jQuery.lastModified[ cacheURL ] = modified; - } - modified = jqXHR.getResponseHeader( "etag" ); - if ( modified ) { - jQuery.etag[ cacheURL ] = modified; - } - } - - // if no content - if ( status === 204 || s.type === "HEAD" ) { - statusText = "nocontent"; - - // if not modified - } else if ( status === 304 ) { - statusText = "notmodified"; - - // If we have data, let's convert it - } else { - statusText = response.state; - success = response.data; - error = response.error; - isSuccess = !error; - } - } else { - - // Extract error from statusText and normalize for non-aborts - error = statusText; - if ( status || !statusText ) { - statusText = "error"; - if ( status < 0 ) { - status = 0; - } - } - } - - // Set data for the fake xhr object - jqXHR.status = status; - jqXHR.statusText = ( nativeStatusText || statusText ) + ""; - - // Success/Error - if ( isSuccess ) { - deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); - } else { - deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); - } - - // Status-dependent callbacks - jqXHR.statusCode( statusCode ); - statusCode = undefined; - - if ( fireGlobals ) { - globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", - [ jqXHR, s, isSuccess ? success : error ] ); - } - - // Complete - completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); - - if ( fireGlobals ) { - globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); - - // Handle the global AJAX counter - if ( !( --jQuery.active ) ) { - jQuery.event.trigger( "ajaxStop" ); - } - } - } - - return jqXHR; - }, - - getJSON: function( url, data, callback ) { - return jQuery.get( url, data, callback, "json" ); - }, - - getScript: function( url, callback ) { - return jQuery.get( url, undefined, callback, "script" ); - } -} ); - -jQuery.each( [ "get", "post" ], function( _i, method ) { - jQuery[ method ] = function( url, data, callback, type ) { - - // Shift arguments if data argument was omitted - if ( isFunction( data ) ) { - type = type || callback; - callback = data; - data = undefined; - } - - // The url can be an options object (which then must have .url) - return jQuery.ajax( jQuery.extend( { - url: url, - type: method, - dataType: type, - data: data, - success: callback - }, jQuery.isPlainObject( url ) && url ) ); - }; -} ); - -jQuery.ajaxPrefilter( function( s ) { - var i; - for ( i in s.headers ) { - if ( i.toLowerCase() === "content-type" ) { - s.contentType = s.headers[ i ] || ""; - } - } -} ); - - -jQuery._evalUrl = function( url, options, doc ) { - return jQuery.ajax( { - url: url, - - // Make this explicit, since user can override this through ajaxSetup (#11264) - type: "GET", - dataType: "script", - cache: true, - async: false, - global: false, - - // Only evaluate the response if it is successful (gh-4126) - // dataFilter is not invoked for failure responses, so using it instead - // of the default converter is kludgy but it works. - converters: { - "text script": function() {} - }, - dataFilter: function( response ) { - jQuery.globalEval( response, options, doc ); - } - } ); -}; - - -jQuery.fn.extend( { - wrapAll: function( html ) { - var wrap; - - if ( this[ 0 ] ) { - if ( isFunction( html ) ) { - html = html.call( this[ 0 ] ); - } - - // The elements to wrap the target around - wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); - - if ( this[ 0 ].parentNode ) { - wrap.insertBefore( this[ 0 ] ); - } - - wrap.map( function() { - var elem = this; - - while ( elem.firstElementChild ) { - elem = elem.firstElementChild; - } - - return elem; - } ).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( isFunction( html ) ) { - return this.each( function( i ) { - jQuery( this ).wrapInner( html.call( this, i ) ); - } ); - } - - return this.each( function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - } ); - }, - - wrap: function( html ) { - var htmlIsFunction = isFunction( html ); - - return this.each( function( i ) { - jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); - } ); - }, - - unwrap: function( selector ) { - this.parent( selector ).not( "body" ).each( function() { - jQuery( this ).replaceWith( this.childNodes ); - } ); - return this; - } -} ); - - -jQuery.expr.pseudos.hidden = function( elem ) { - return !jQuery.expr.pseudos.visible( elem ); -}; -jQuery.expr.pseudos.visible = function( elem ) { - return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); -}; - - - - -jQuery.ajaxSettings.xhr = function() { - try { - return new window.XMLHttpRequest(); - } catch ( e ) {} -}; - -var xhrSuccessStatus = { - - // File protocol always yields status code 0, assume 200 - 0: 200, - - // Support: IE <=9 only - // #1450: sometimes IE returns 1223 when it should be 204 - 1223: 204 - }, - xhrSupported = jQuery.ajaxSettings.xhr(); - -support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); -support.ajax = xhrSupported = !!xhrSupported; - -jQuery.ajaxTransport( function( options ) { - var callback, errorCallback; - - // Cross domain only allowed if supported through XMLHttpRequest - if ( support.cors || xhrSupported && !options.crossDomain ) { - return { - send: function( headers, complete ) { - var i, - xhr = options.xhr(); - - xhr.open( - options.type, - options.url, - options.async, - options.username, - options.password - ); - - // Apply custom fields if provided - if ( options.xhrFields ) { - for ( i in options.xhrFields ) { - xhr[ i ] = options.xhrFields[ i ]; - } - } - - // Override mime type if needed - if ( options.mimeType && xhr.overrideMimeType ) { - xhr.overrideMimeType( options.mimeType ); - } - - // X-Requested-With header - // For cross-domain requests, seeing as conditions for a preflight are - // akin to a jigsaw puzzle, we simply never set it to be sure. - // (it can always be set on a per-request basis or even using ajaxSetup) - // For same-domain requests, won't change header if already provided. - if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { - headers[ "X-Requested-With" ] = "XMLHttpRequest"; - } - - // Set headers - for ( i in headers ) { - xhr.setRequestHeader( i, headers[ i ] ); - } - - // Callback - callback = function( type ) { - return function() { - if ( callback ) { - callback = errorCallback = xhr.onload = - xhr.onerror = xhr.onabort = xhr.ontimeout = - xhr.onreadystatechange = null; - - if ( type === "abort" ) { - xhr.abort(); - } else if ( type === "error" ) { - - // Support: IE <=9 only - // On a manual native abort, IE9 throws - // errors on any property access that is not readyState - if ( typeof xhr.status !== "number" ) { - complete( 0, "error" ); - } else { - complete( - - // File: protocol always yields status 0; see #8605, #14207 - xhr.status, - xhr.statusText - ); - } - } else { - complete( - xhrSuccessStatus[ xhr.status ] || xhr.status, - xhr.statusText, - - // Support: IE <=9 only - // IE9 has no XHR2 but throws on binary (trac-11426) - // For XHR2 non-text, let the caller handle it (gh-2498) - ( xhr.responseType || "text" ) !== "text" || - typeof xhr.responseText !== "string" ? - { binary: xhr.response } : - { text: xhr.responseText }, - xhr.getAllResponseHeaders() - ); - } - } - }; - }; - - // Listen to events - xhr.onload = callback(); - errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); - - // Support: IE 9 only - // Use onreadystatechange to replace onabort - // to handle uncaught aborts - if ( xhr.onabort !== undefined ) { - xhr.onabort = errorCallback; - } else { - xhr.onreadystatechange = function() { - - // Check readyState before timeout as it changes - if ( xhr.readyState === 4 ) { - - // Allow onerror to be called first, - // but that will not handle a native abort - // Also, save errorCallback to a variable - // as xhr.onerror cannot be accessed - window.setTimeout( function() { - if ( callback ) { - errorCallback(); - } - } ); - } - }; - } - - // Create the abort callback - callback = callback( "abort" ); - - try { - - // Do send the request (this may raise an exception) - xhr.send( options.hasContent && options.data || null ); - } catch ( e ) { - - // #14683: Only rethrow if this hasn't been notified as an error yet - if ( callback ) { - throw e; - } - } - }, - - abort: function() { - if ( callback ) { - callback(); - } - } - }; - } -} ); - - - - -// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) -jQuery.ajaxPrefilter( function( s ) { - if ( s.crossDomain ) { - s.contents.script = false; - } -} ); - -// Install script dataType -jQuery.ajaxSetup( { - accepts: { - script: "text/javascript, application/javascript, " + - "application/ecmascript, application/x-ecmascript" - }, - contents: { - script: /\b(?:java|ecma)script\b/ - }, - converters: { - "text script": function( text ) { - jQuery.globalEval( text ); - return text; - } - } -} ); - -// Handle cache's special case and crossDomain -jQuery.ajaxPrefilter( "script", function( s ) { - if ( s.cache === undefined ) { - s.cache = false; - } - if ( s.crossDomain ) { - s.type = "GET"; - } -} ); - -// Bind script tag hack transport -jQuery.ajaxTransport( "script", function( s ) { - - // This transport only deals with cross domain or forced-by-attrs requests - if ( s.crossDomain || s.scriptAttrs ) { - var script, callback; - return { - send: function( _, complete ) { - script = jQuery( " - + @@ -44,7 +44,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -783,12 +792,12 @@ document.write(` @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/dev/metal_debugger.html b/docs/build/html/dev/metal_debugger.html index 49a253fca..f61a45a8c 100644 --- a/docs/build/html/dev/metal_debugger.html +++ b/docs/build/html/dev/metal_debugger.html @@ -8,7 +8,7 @@ - Metal Debugger — MLX 0.10.0 documentation + Metal Debugger — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -130,8 +130,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -239,6 +239,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -803,10 +812,9 @@ work.

    trace_file = "mlx_trace.gputrace" -if not mx.metal.start_capture(trace_file): - print("Make sure to run with MTL_CAPTURE_ENABLED=1 and " - f"that the path {trace_file} does not already exist.") - exit(1) +# Make sure to run with MTL_CAPTURE_ENABLED=1 and +# that the path trace_file does not already exist. +mx.metal.start_capture(trace_file) for _ in range(10): mx.eval(mx.add(a, b)) diff --git a/docs/build/html/examples/linear_regression.html b/docs/build/html/examples/linear_regression.html index 412df205f..a923b12f6 100644 --- a/docs/build/html/examples/linear_regression.html +++ b/docs/build/html/examples/linear_regression.html @@ -8,7 +8,7 @@ - Linear Regression — MLX 0.10.0 documentation + Linear Regression — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/examples/llama-inference.html b/docs/build/html/examples/llama-inference.html index 51299482e..986c7c580 100644 --- a/docs/build/html/examples/llama-inference.html +++ b/docs/build/html/examples/llama-inference.html @@ -8,7 +8,7 @@ - LLM inference — MLX 0.10.0 documentation + LLM inference — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/examples/mlp.html b/docs/build/html/examples/mlp.html index c96c1c38b..6f4475d14 100644 --- a/docs/build/html/examples/mlp.html +++ b/docs/build/html/examples/mlp.html @@ -8,7 +8,7 @@ - Multi-Layer Perceptron — MLX 0.10.0 documentation + Multi-Layer Perceptron — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/genindex.html b/docs/build/html/genindex.html index 70a378f6e..c28ff5356 100644 --- a/docs/build/html/genindex.html +++ b/docs/build/html/genindex.html @@ -7,7 +7,7 @@ - Index — MLX 0.10.0 documentation + Index — MLX 0.12.0 documentation @@ -35,7 +35,7 @@ - + @@ -128,8 +128,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -237,6 +237,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -872,7 +881,9 @@ document.write(`
  • +
  • mlx.nn.QuantizedEmbedding +
  • mlx.nn.QuantizedLinear @@ -1164,146 +1180,146 @@ parameters as the first argument to the function returned by
  • Functions
  • Loss Functions diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.ALiBi.html b/docs/build/html/python/nn/_autosummary/mlx.nn.ALiBi.html index d787a6459..5c188aaf6 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.ALiBi.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.ALiBi.html @@ -8,7 +8,7 @@ - mlx.nn.ALiBi — MLX 0.10.0 documentation + mlx.nn.ALiBi — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -782,7 +791,18 @@ document.write(`
    class ALiBi#
    -
    +

    Methods

    + + + + + + + + + +

    create_alibi_matrix(q_sequence_length, ...)

    create_alibi_slope(num_heads)

    +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.AvgPool1d.html b/docs/build/html/python/nn/_autosummary/mlx.nn.AvgPool1d.html index c1361498f..1a3b1c2a5 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.AvgPool1d.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.AvgPool1d.html @@ -8,7 +8,7 @@ - mlx.nn.AvgPool1d — MLX 0.10.0 documentation + mlx.nn.AvgPool1d — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -814,6 +823,11 @@ axis. Default: 0>>> pool(x) +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.AvgPool2d.html b/docs/build/html/python/nn/_autosummary/mlx.nn.AvgPool2d.html index d500f037a..837b69be7 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.AvgPool2d.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.AvgPool2d.html @@ -8,7 +8,7 @@ - mlx.nn.AvgPool2d — MLX 0.10.0 documentation + mlx.nn.AvgPool2d — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -820,10 +829,15 @@ of the height and width axis. Default:
    >>> import mlx.core as mx
     >>> import mlx.nn.layers as nn
     >>> x = mx.random.normal(shape=(8, 32, 32, 4))
    ->>> pool = nn.MaxPool2d(kernel_size=2, stride=2)
    +>>> pool = nn.AvgPool2d(kernel_size=2, stride=2)
     >>> pool(x)
     
    +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.BatchNorm.html b/docs/build/html/python/nn/_autosummary/mlx.nn.BatchNorm.html index 09aa323d9..9cadf259c 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.BatchNorm.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.BatchNorm.html @@ -8,7 +8,7 @@ - mlx.nn.BatchNorm — MLX 0.10.0 documentation + mlx.nn.BatchNorm — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -820,6 +829,14 @@ running mean and variance. Default: < >>> output = bn(x) +

    Methods

    + + + + + + +

    unfreeze(*args, **kwargs)

    Wrap unfreeze to make sure that running_mean and var are always frozen parameters.

    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Conv1d.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Conv1d.html index f1641a608..66a0f81c3 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Conv1d.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Conv1d.html @@ -8,7 +8,7 @@ - mlx.nn.Conv1d — MLX 0.10.0 documentation + mlx.nn.Conv1d — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -807,6 +816,11 @@ Default: True +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Conv2d.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Conv2d.html index eb774279c..b453b8c03 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Conv2d.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Conv2d.html @@ -8,7 +8,7 @@ - mlx.nn.Conv2d — MLX 0.10.0 documentation + mlx.nn.Conv2d — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -808,6 +817,11 @@ output. Default: Tr +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Dropout.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Dropout.html index 86a245916..c38279808 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Dropout.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Dropout.html @@ -8,7 +8,7 @@ - mlx.nn.Dropout — MLX 0.10.0 documentation + mlx.nn.Dropout — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -792,6 +801,11 @@ expected value of a given element will remain the same.

    p (float) – The probability to zero an element

    +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Dropout2d.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Dropout2d.html index b26a12c87..b3902f22f 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Dropout2d.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Dropout2d.html @@ -8,7 +8,7 @@ - mlx.nn.Dropout2d — MLX 0.10.0 documentation + mlx.nn.Dropout2d — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -802,6 +811,11 @@ Efficient Object Localization Using Convolutional Networks. CVPR 2015.

    p (float) – Probability of zeroing a channel during training.

    +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Dropout3d.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Dropout3d.html index d5190f71c..b36bdf5c9 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Dropout3d.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Dropout3d.html @@ -8,7 +8,7 @@ - mlx.nn.Dropout3d — MLX 0.10.0 documentation + mlx.nn.Dropout3d — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -799,6 +808,11 @@ medical imaging or video processing.

    p (float) – Probability of zeroing a channel during training.

    +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Embedding.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Embedding.html index ac63523ce..2520a7a9d 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Embedding.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Embedding.html @@ -8,7 +8,7 @@ - mlx.nn.Embedding — MLX 0.10.0 documentation + mlx.nn.Embedding — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -794,6 +803,14 @@ Usually called the vocabulary size.

  • +

    Methods

    + + + + + + +

    as_linear(x)

    Call the embedding layer as a linear layer.

    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.GELU.html b/docs/build/html/python/nn/_autosummary/mlx.nn.GELU.html index f902cd481..27e5a6e4e 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.GELU.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.GELU.html @@ -8,7 +8,7 @@ - mlx.nn.GELU — MLX 0.10.0 documentation + mlx.nn.GELU — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -789,7 +798,7 @@ document.write(`

    where \(\Phi(x)\) is the Gaussian CDF.

    However, if approx is set to ‘precise’ or ‘fast’ it applies

    -\[\begin{split}\textrm{GELUApprox}(x) &= x * \sigma\left(1.60033 * x \left(1 + 0.0433603 * x^2\right)\right) \\ +\[\begin{split}\textrm{GELUApprox}(x) &= 0.5 * x * \left(1 + \text{Tanh}\left((\sqrt{2 / \pi} * \left(x + 0.044715 * x^3\right)\right)\right) \\ \textrm{GELUFast}(x) &= x * \sigma\left(1.773 * x\right)\end{split}\]

    respectively.

    See gelu(), gelu_approx() and gelu_fast_approx() for the @@ -799,6 +808,11 @@ functional equivalents and information regarding error bounds.

    approx ('none' | 'precise' | 'fast') – Which approximation to gelu to use if any.

    +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.GRU.html b/docs/build/html/python/nn/_autosummary/mlx.nn.GRU.html index d192c03c1..4c059f7b1 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.GRU.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.GRU.html @@ -8,7 +8,7 @@ - mlx.nn.GRU — MLX 0.10.0 documentation + mlx.nn.GRU — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -810,6 +819,11 @@ time step of shape +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.GroupNorm.html b/docs/build/html/python/nn/_autosummary/mlx.nn.GroupNorm.html index e6eff2de5..88bec49c2 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.GroupNorm.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.GroupNorm.html @@ -8,7 +8,7 @@ - mlx.nn.GroupNorm — MLX 0.10.0 documentation + mlx.nn.GroupNorm — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -808,6 +817,11 @@ the same order/grouping as PyTorch.

  • +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.InstanceNorm.html b/docs/build/html/python/nn/_autosummary/mlx.nn.InstanceNorm.html index b0840f43c..44ab15fa7 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.InstanceNorm.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.InstanceNorm.html @@ -8,7 +8,7 @@ - mlx.nn.InstanceNorm — MLX 0.10.0 documentation + mlx.nn.InstanceNorm — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -816,6 +825,11 @@ if

    References

    [1]: https://arxiv.org/abs/1607.08022

    +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.LSTM.html b/docs/build/html/python/nn/_autosummary/mlx.nn.LSTM.html index 02daf3bc0..910515ee8 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.LSTM.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.LSTM.html @@ -8,7 +8,7 @@ - mlx.nn.LSTM — MLX 0.10.0 documentation + mlx.nn.LSTM — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -813,6 +822,11 @@ each time step, both of shape +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.LayerNorm.html b/docs/build/html/python/nn/_autosummary/mlx.nn.LayerNorm.html index e7a006032..58b9cf310 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.LayerNorm.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.LayerNorm.html @@ -8,7 +8,7 @@ - mlx.nn.LayerNorm — MLX 0.10.0 documentation + mlx.nn.LayerNorm — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -803,6 +812,11 @@ just scaling.

  • +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Linear.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Linear.html index 5d8c04319..cf0d8b390 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Linear.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Linear.html @@ -8,7 +8,7 @@ - mlx.nn.Linear — MLX 0.10.0 documentation + mlx.nn.Linear — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -801,6 +810,11 @@ not use a bias. Default is +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.MaxPool1d.html b/docs/build/html/python/nn/_autosummary/mlx.nn.MaxPool1d.html index 1f62c905e..1e61e4390 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.MaxPool1d.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.MaxPool1d.html @@ -8,7 +8,7 @@ - mlx.nn.MaxPool1d — MLX 0.10.0 documentation + mlx.nn.MaxPool1d — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -814,6 +823,11 @@ both sides of the spatial axis. Default: >>> pool(x) +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.MaxPool2d.html b/docs/build/html/python/nn/_autosummary/mlx.nn.MaxPool2d.html index 29caf0e91..0e77bcd0e 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.MaxPool2d.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.MaxPool2d.html @@ -8,7 +8,7 @@ - mlx.nn.MaxPool2d — MLX 0.10.0 documentation + mlx.nn.MaxPool2d — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -824,6 +833,11 @@ of the height and width axis. Default: >>> pool(x) +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Mish.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Mish.html index 1737fbddb..9c34fcb9f 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Mish.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Mish.html @@ -8,7 +8,7 @@ - mlx.nn.Mish — MLX 0.10.0 documentation + mlx.nn.Mish — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -787,6 +796,11 @@ document.write(`

    Reference: https://arxiv.org/abs/1908.08681

    \[\text{Mish}(x) = x * \text{Tanh}(\text{Softplus}(x))\]
    +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.apply.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.apply.html index 555caaf8a..f4c5b4a94 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.apply.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.apply.html @@ -8,7 +8,7 @@ - mlx.nn.Module.apply — MLX 0.10.0 documentation + mlx.nn.Module.apply — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.apply_to_modules.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.apply_to_modules.html index f939712e6..7b75dfd83 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.apply_to_modules.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.apply_to_modules.html @@ -8,7 +8,7 @@ - mlx.nn.Module.apply_to_modules — MLX 0.10.0 documentation + mlx.nn.Module.apply_to_modules — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.children.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.children.html index 4b9478a40..1d4c1ca57 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.children.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.children.html @@ -8,7 +8,7 @@ - mlx.nn.Module.children — MLX 0.10.0 documentation + mlx.nn.Module.children — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.eval.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.eval.html index 86062980f..238c05a78 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.eval.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.eval.html @@ -8,7 +8,7 @@ - mlx.nn.Module.eval — MLX 0.10.0 documentation + mlx.nn.Module.eval — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.filter_and_map.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.filter_and_map.html index 13d8d00a4..be5399a38 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.filter_and_map.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.filter_and_map.html @@ -8,7 +8,7 @@ - mlx.nn.Module.filter_and_map — MLX 0.10.0 documentation + mlx.nn.Module.filter_and_map — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.freeze.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.freeze.html index d142a1045..af360a520 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.freeze.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.freeze.html @@ -8,7 +8,7 @@ - mlx.nn.Module.freeze — MLX 0.10.0 documentation + mlx.nn.Module.freeze — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.leaf_modules.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.leaf_modules.html index bb4f48dca..a36109ac1 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.leaf_modules.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.leaf_modules.html @@ -8,7 +8,7 @@ - mlx.nn.Module.leaf_modules — MLX 0.10.0 documentation + mlx.nn.Module.leaf_modules — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.load_weights.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.load_weights.html index dc4b0acf2..9cfdf8f06 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.load_weights.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.load_weights.html @@ -8,7 +8,7 @@ - mlx.nn.Module.load_weights — MLX 0.10.0 documentation + mlx.nn.Module.load_weights — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.modules.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.modules.html index caaaf5623..f0b41f54d 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.modules.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.modules.html @@ -8,7 +8,7 @@ - mlx.nn.Module.modules — MLX 0.10.0 documentation + mlx.nn.Module.modules — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.named_modules.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.named_modules.html index 28d8a7b4b..019439c07 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.named_modules.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.named_modules.html @@ -8,7 +8,7 @@ - mlx.nn.Module.named_modules — MLX 0.10.0 documentation + mlx.nn.Module.named_modules — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.parameters.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.parameters.html index de87aa721..37336d861 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.parameters.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.parameters.html @@ -8,7 +8,7 @@ - mlx.nn.Module.parameters — MLX 0.10.0 documentation + mlx.nn.Module.parameters — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.save_weights.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.save_weights.html index a5f4609a6..e275e35d5 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.save_weights.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.save_weights.html @@ -8,7 +8,7 @@ - mlx.nn.Module.save_weights — MLX 0.10.0 documentation + mlx.nn.Module.save_weights — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.set_dtype.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.set_dtype.html index f614b9839..3abedf928 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.set_dtype.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.set_dtype.html @@ -8,7 +8,7 @@ - mlx.nn.Module.set_dtype — MLX 0.10.0 documentation + mlx.nn.Module.set_dtype — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.state.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.state.html index 0190b9bc6..f8072ccc0 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.state.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.state.html @@ -8,7 +8,7 @@ - mlx.nn.Module.state — MLX 0.10.0 documentation + mlx.nn.Module.state — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.train.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.train.html index bac16431a..f49748fe1 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.train.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.train.html @@ -8,7 +8,7 @@ - mlx.nn.Module.train — MLX 0.10.0 documentation + mlx.nn.Module.train — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.trainable_parameters.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.trainable_parameters.html index bf19b196c..1d07ea0fb 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.trainable_parameters.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.trainable_parameters.html @@ -8,7 +8,7 @@ - mlx.nn.Module.trainable_parameters — MLX 0.10.0 documentation + mlx.nn.Module.trainable_parameters — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.training.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.training.html index 6413e6807..d98773ef1 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.training.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.training.html @@ -8,7 +8,7 @@ - mlx.nn.Module.training — MLX 0.10.0 documentation + mlx.nn.Module.training — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.unfreeze.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.unfreeze.html index 7f1820d8a..4ec69d6dd 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.unfreeze.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.unfreeze.html @@ -8,7 +8,7 @@ - mlx.nn.Module.unfreeze — MLX 0.10.0 documentation + mlx.nn.Module.unfreeze — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.update.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.update.html index 206e287e8..0190cf451 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.update.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.update.html @@ -8,7 +8,7 @@ - mlx.nn.Module.update — MLX 0.10.0 documentation + mlx.nn.Module.update — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.update_modules.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.update_modules.html index 6a659b12d..f0ec8a07b 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Module.update_modules.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Module.update_modules.html @@ -8,7 +8,7 @@ - mlx.nn.Module.update_modules — MLX 0.10.0 documentation + mlx.nn.Module.update_modules — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.MultiHeadAttention.html b/docs/build/html/python/nn/_autosummary/mlx.nn.MultiHeadAttention.html index 89acb4fce..1f8e257eb 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.MultiHeadAttention.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.MultiHeadAttention.html @@ -8,7 +8,7 @@ - mlx.nn.MultiHeadAttention — MLX 0.10.0 documentation + mlx.nn.MultiHeadAttention — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -813,6 +822,14 @@ Default: False +

    Methods

    + + + + + + +

    create_additive_causal_mask(N[, dtype])

    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.PReLU.html b/docs/build/html/python/nn/_autosummary/mlx.nn.PReLU.html index 9d2c20f06..3d5af4454 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.PReLU.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.PReLU.html @@ -8,7 +8,7 @@ - mlx.nn.PReLU — MLX 0.10.0 documentation + mlx.nn.PReLU — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -44,7 +44,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -797,6 +806,11 @@ is an array.

    +

    Methods

    + + + +
    @@ -822,11 +836,11 @@ is an array.

    next

    -

    mlx.nn.QuantizedLinear

    +

    mlx.nn.QuantizedEmbedding

    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.QuantizedEmbedding.html b/docs/build/html/python/nn/_autosummary/mlx.nn.QuantizedEmbedding.html new file mode 100644 index 000000000..548960716 --- /dev/null +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.QuantizedEmbedding.html @@ -0,0 +1,925 @@ + + + + + + + + + + + mlx.nn.QuantizedEmbedding — MLX 0.12.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    +
    +
    +
    +
    + + + +
    +
    + +
    + + + + + + + + + + + + + +
    + +
    + + + +
    + +
    +
    + +
    +
    + +
    + +
    + +
    + + +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    +
    + + + +
    +

    mlx.nn.QuantizedEmbedding

    + +
    +
    + +
    +

    Contents

    +
    + +
    +
    +
    + + + + +
    + +
    +

    mlx.nn.QuantizedEmbedding#

    +
    +
    +class QuantizedEmbedding(num_embeddings: int, dims: int, group_size: int = 64, bits: int = 4)#
    +

    The same as Embedding but with a quantized weight matrix.

    +

    QuantizedEmbedding also provides a from_embedding() +classmethod to convert embedding layers to QuantizedEmbedding +layers.

    +
    +
    Parameters:
    +
      +
    • num_embeddings (int) – How many possible discrete tokens can we embed. +Usually called the vocabulary size.

    • +
    • dims (int) – The dimensionality of the embeddings.

    • +
    • group_size (int, optional) – The group size to use for the quantized +weight. See quantize(). Default: 64.

    • +
    • bits (int, optional) – The bit width to use for the quantized weight. +See quantize(). Default: 4.

    • +
    +
    +
    +

    Methods

    + + + + + + + + + +

    as_linear(x)

    Call the quantized embedding layer as a quantized linear layer.

    from_embedding(embedding_layer[, ...])

    Create a QuantizedEmbedding layer from an Embedding layer.

    +
    + +
    + + +
    + + + + + + + + +
    + + + +
    + + +
    +
    + + +
    + + +
    +
    +
    + + + + + +
    +
    + + \ No newline at end of file diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.QuantizedLinear.html b/docs/build/html/python/nn/_autosummary/mlx.nn.QuantizedLinear.html index e61e5025b..4c978008e 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.QuantizedLinear.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.QuantizedLinear.html @@ -8,7 +8,7 @@ - mlx.nn.QuantizedLinear — MLX 0.10.0 documentation + mlx.nn.QuantizedLinear — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -44,7 +44,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -786,28 +795,33 @@ document.write(`

    It is the quantized equivalent of mlx.nn.Linear. For now its parameters are frozen and will not be included in any gradient computation but this will probably change in the future.

    -

    QuantizedLinear also provides two useful classmethods to convert linear -layers to QuantizedLinear layers.

    -
      -
    • from_linear() returns a QuantizedLinear layer that applies the same -linear transformation up to the quantization error.

    • -
    • quantize_module() swaps all the linear layers of the passed module -with QuantizedLinear ones.

    • -
    +

    QuantizedLinear also provides a classmethod from_linear() to +convert linear layers to QuantizedLinear layers.

    Parameters:
      -
    • input_dims (int) – The dimensionality of the input features

    • -
    • output_dims (int) – The dimensionality of the output features

    • +
    • input_dims (int) – The dimensionality of the input features.

    • +
    • output_dims (int) – The dimensionality of the output features.

    • bias (bool, optional) – If set to False then the layer will not use -a bias. (default: True).

    • +a bias. Default: True.

    • group_size (int, optional) – The group size to use for the quantized -weight. See quantize(). (default: 64)

    • +weight. See quantize(). Default: 64.

    • bits (int, optional) – The bit width to use for the quantized weight. -See quantize(). (default: 4)

    • +See quantize(). Default: 4.

    +

    Methods

    + + + + + + + + + +

    from_linear(linear_layer[, group_size, bits])

    Create a QuantizedLinear layer from a Linear layer.

    unfreeze(*args, **kwargs)

    Wrap unfreeze so that we unfreeze any layers we might contain but our parameters will remain frozen.

    @@ -824,12 +838,12 @@ See

    previous

    -

    mlx.nn.PReLU

    +

    mlx.nn.QuantizedEmbedding

    - mlx.nn.RMSNorm — MLX 0.10.0 documentation + mlx.nn.RMSNorm — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -799,6 +808,11 @@ document.write(` +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.RNN.html b/docs/build/html/python/nn/_autosummary/mlx.nn.RNN.html index eb98a9423..cf8b2da34 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.RNN.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.RNN.html @@ -8,7 +8,7 @@ - mlx.nn.RNN — MLX 0.10.0 documentation + mlx.nn.RNN — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -808,6 +817,11 @@ then func:tanh is used. Default: Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.ReLU.html b/docs/build/html/python/nn/_autosummary/mlx.nn.ReLU.html index 8a60f28a7..cd4ccff83 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.ReLU.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.ReLU.html @@ -8,7 +8,7 @@ - mlx.nn.ReLU — MLX 0.10.0 documentation + mlx.nn.ReLU — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -787,6 +796,11 @@ document.write(`

    See relu() for the functional equivalent.

    +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.RoPE.html b/docs/build/html/python/nn/_autosummary/mlx.nn.RoPE.html index f77183d5c..8deea1a86 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.RoPE.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.RoPE.html @@ -8,7 +8,7 @@ - mlx.nn.RoPE — MLX 0.10.0 documentation + mlx.nn.RoPE — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -801,6 +810,11 @@ each dimension in the positional encodings. Default: Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.SELU.html b/docs/build/html/python/nn/_autosummary/mlx.nn.SELU.html index 448ba4760..0cc359ee9 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.SELU.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.SELU.html @@ -8,7 +8,7 @@ - mlx.nn.SELU — MLX 0.10.0 documentation + mlx.nn.SELU — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -784,6 +793,11 @@ document.write(` class SELU#

    Applies the Scaled Exponential Linear Unit.

    See selu() for the functional equivalent.

    +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Sequential.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Sequential.html index f83359d1b..24c26c54a 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Sequential.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Sequential.html @@ -8,7 +8,7 @@ - mlx.nn.Sequential — MLX 0.10.0 documentation + mlx.nn.Sequential — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -791,6 +800,11 @@ our functions have learnable parameters they should be implemented as

    modules (tuple of Callables) – The modules to call in order

    +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.SiLU.html b/docs/build/html/python/nn/_autosummary/mlx.nn.SiLU.html index 9da44b69b..62984a6ea 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.SiLU.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.SiLU.html @@ -8,7 +8,7 @@ - mlx.nn.SiLU — MLX 0.10.0 documentation + mlx.nn.SiLU — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -784,6 +793,11 @@ document.write(` class SiLU#

    Applies the Sigmoid Linear Unit. Also known as Swish.

    See silu() for the functional equivalent.

    +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.SinusoidalPositionalEncoding.html b/docs/build/html/python/nn/_autosummary/mlx.nn.SinusoidalPositionalEncoding.html index 2ff69b8f5..7925b5faf 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.SinusoidalPositionalEncoding.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.SinusoidalPositionalEncoding.html @@ -8,7 +8,7 @@ - mlx.nn.SinusoidalPositionalEncoding — MLX 0.10.0 documentation + mlx.nn.SinusoidalPositionalEncoding — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -802,6 +811,11 @@ instead of the reverse. Default: +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Softshrink.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Softshrink.html index 433b58911..02524d23a 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Softshrink.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Softshrink.html @@ -8,7 +8,7 @@ - mlx.nn.Softshrink — MLX 0.10.0 documentation + mlx.nn.Softshrink — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -790,6 +799,11 @@ document.write(`

    lambd – the \(\lambda\) value for Softshrink. Default: 0.5

    +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Step.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Step.html index d5ddc7390..12061457e 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Step.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Step.html @@ -8,7 +8,7 @@ - mlx.nn.Step — MLX 0.10.0 documentation + mlx.nn.Step — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -796,6 +805,11 @@ to 1 if the input is greater than a specified threshold, and 0 otherwise.

    threshold – The value to threshold at.

    +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Transformer.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Transformer.html index 96295904c..8fc670eda 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Transformer.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Transformer.html @@ -8,7 +8,7 @@ - mlx.nn.Transformer — MLX 0.10.0 documentation + mlx.nn.Transformer — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -820,6 +829,11 @@ Default: False +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.Upsample.html b/docs/build/html/python/nn/_autosummary/mlx.nn.Upsample.html index 623321728..915e09eee 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.Upsample.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.Upsample.html @@ -8,7 +8,7 @@ - mlx.nn.Upsample — MLX 0.10.0 documentation + mlx.nn.Upsample — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -844,6 +853,11 @@ examples below for more details. Default: [3, 3.33333, 3.66667, 4]], dtype=float32) +

    Methods

    + + + +
    diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.init.constant.html b/docs/build/html/python/nn/_autosummary/mlx.nn.init.constant.html index 982cf049c..dc3984d40 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.init.constant.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.init.constant.html @@ -8,7 +8,7 @@ - mlx.nn.init.constant — MLX 0.10.0 documentation + mlx.nn.init.constant — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.init.glorot_normal.html b/docs/build/html/python/nn/_autosummary/mlx.nn.init.glorot_normal.html index 3735e84bd..1fe8bd360 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.init.glorot_normal.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.init.glorot_normal.html @@ -8,7 +8,7 @@ - mlx.nn.init.glorot_normal — MLX 0.10.0 documentation + mlx.nn.init.glorot_normal — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.init.glorot_uniform.html b/docs/build/html/python/nn/_autosummary/mlx.nn.init.glorot_uniform.html index 57b358289..2533f1bd3 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.init.glorot_uniform.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.init.glorot_uniform.html @@ -8,7 +8,7 @@ - mlx.nn.init.glorot_uniform — MLX 0.10.0 documentation + mlx.nn.init.glorot_uniform — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.init.he_normal.html b/docs/build/html/python/nn/_autosummary/mlx.nn.init.he_normal.html index c0927f695..f48049e5d 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.init.he_normal.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.init.he_normal.html @@ -8,7 +8,7 @@ - mlx.nn.init.he_normal — MLX 0.10.0 documentation + mlx.nn.init.he_normal — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.init.he_uniform.html b/docs/build/html/python/nn/_autosummary/mlx.nn.init.he_uniform.html index 1893bd20c..5a821051f 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.init.he_uniform.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.init.he_uniform.html @@ -8,7 +8,7 @@ - mlx.nn.init.he_uniform — MLX 0.10.0 documentation + mlx.nn.init.he_uniform — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.init.identity.html b/docs/build/html/python/nn/_autosummary/mlx.nn.init.identity.html index a7c0fc6d9..1d8b62c01 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.init.identity.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.init.identity.html @@ -8,7 +8,7 @@ - mlx.nn.init.identity — MLX 0.10.0 documentation + mlx.nn.init.identity — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.init.normal.html b/docs/build/html/python/nn/_autosummary/mlx.nn.init.normal.html index 687144728..e1b838820 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.init.normal.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.init.normal.html @@ -8,7 +8,7 @@ - mlx.nn.init.normal — MLX 0.10.0 documentation + mlx.nn.init.normal — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary/mlx.nn.init.uniform.html b/docs/build/html/python/nn/_autosummary/mlx.nn.init.uniform.html index 6af5e8fc0..95a162251 100644 --- a/docs/build/html/python/nn/_autosummary/mlx.nn.init.uniform.html +++ b/docs/build/html/python/nn/_autosummary/mlx.nn.init.uniform.html @@ -8,7 +8,7 @@ - mlx.nn.init.uniform — MLX 0.10.0 documentation + mlx.nn.init.uniform — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.elu.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.elu.html index bd5ad21f6..fc33332de 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.elu.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.elu.html @@ -8,7 +8,7 @@ - mlx.nn.elu — MLX 0.10.0 documentation + mlx.nn.elu — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -765,7 +774,7 @@ document.write(` @@ -779,9 +788,9 @@ document.write(`

    mlx.nn.elu#

    -
    +
    -elu(x, alpha=1.0)#
    +class elu(x, alpha=1.0)#

    Applies the Exponential Linear Unit.

    Simply mx.where(x > 0, x, alpha * (mx.exp(x) - 1)).

    @@ -832,7 +841,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.gelu.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.gelu.html index 4831de6fe..0e6d27e28 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.gelu.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.gelu.html @@ -8,7 +8,7 @@ - mlx.nn.gelu — MLX 0.10.0 documentation + mlx.nn.gelu — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.gelu#

    -
    +
    -gelu(x) array#
    +class gelu(x)#

    Applies the Gaussian Error Linear Units function.

    \[\textrm{GELU}(x) = x * \Phi(x)\]
    @@ -837,7 +846,7 @@ approximations.

    diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.gelu_approx.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.gelu_approx.html index 12c18af20..3fceb215a 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.gelu_approx.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.gelu_approx.html @@ -8,7 +8,7 @@ - mlx.nn.gelu_approx — MLX 0.10.0 documentation + mlx.nn.gelu_approx — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,16 +789,15 @@ document.write(`

    mlx.nn.gelu_approx#

    -
    +
    -gelu_approx(x)#
    +class gelu_approx(x)#

    An approximation to Gaussian Error Linear Unit.

    See gelu() for the exact computation.

    This function approximates gelu with a maximum absolute error \(< -0.0003\) in the range \([-6, 6]\) using the following

    +0.0005\) in the range \([-6, 6]\) using the following

    -\[x = x \sigma\left(1.60033 x \left(1 + 0.0433603 x^2\right)\right)\]
    -

    where \(\sigma(\cdot)\) is the logistic sigmoid.

    +\[x = 0.5 * x * \left(1 + \text{Tanh}\left((\sqrt{2 / \pi} * \left(x + 0.044715 * x^3\right)\right)\right)\]
    @@ -838,7 +846,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.gelu_fast_approx.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.gelu_fast_approx.html index c4ccd686c..392b3d641 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.gelu_fast_approx.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.gelu_fast_approx.html @@ -8,7 +8,7 @@ - mlx.nn.gelu_fast_approx — MLX 0.10.0 documentation + mlx.nn.gelu_fast_approx — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.gelu_fast_approx#

    -
    +
    -gelu_fast_approx(x)#
    +class gelu_fast_approx(x)#

    A fast approximation to Gaussian Error Linear Unit.

    See gelu() for the exact computation.

    This function approximates gelu with a maximum absolute error \(< @@ -841,7 +850,7 @@ document.write(`

    diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.glu.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.glu.html index 8771de385..e49663ee7 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.glu.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.glu.html @@ -8,7 +8,7 @@ - mlx.nn.glu — MLX 0.10.0 documentation + mlx.nn.glu — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.glu#

    -
    +
    -glu(x: array, axis: int = -1) array#
    +class glu(x: array, axis: int = -1)#

    Applies the gated linear unit function.

    This function splits the axis dimension of the input into two halves (\(a\) and \(b\)) and applies \(a * \sigma(b)\).

    @@ -841,7 +850,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.hardswish.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.hardswish.html index 963fcf3e4..de757ce0e 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.hardswish.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.hardswish.html @@ -8,7 +8,7 @@ - mlx.nn.hardswish — MLX 0.10.0 documentation + mlx.nn.hardswish — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.hardswish#

    -
    +
    -hardswish(x)#
    +class hardswish(x)#

    Applies the hardswish function, element-wise.

    \[\text{Hardswish}(x) = x * \min(\max(x + 3, 0), 6) / 6\]
    @@ -834,7 +843,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.leaky_relu.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.leaky_relu.html index 6c42daa6a..672ddb30e 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.leaky_relu.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.leaky_relu.html @@ -8,7 +8,7 @@ - mlx.nn.leaky_relu — MLX 0.10.0 documentation + mlx.nn.leaky_relu — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -765,7 +774,7 @@ document.write(` @@ -779,9 +788,9 @@ document.write(`

    mlx.nn.leaky_relu#

    -
    +
    -leaky_relu(x, negative_slope=0.01)#
    +class leaky_relu(x, negative_slope=0.01)#

    Applies the Leaky Rectified Linear Unit.

    Simply mx.maximum(negative_slope * x, x).

    @@ -832,7 +841,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.log_sigmoid.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.log_sigmoid.html index 25daf75f7..3a1b39df0 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.log_sigmoid.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.log_sigmoid.html @@ -8,7 +8,7 @@ - mlx.nn.log_sigmoid — MLX 0.10.0 documentation + mlx.nn.log_sigmoid — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.log_sigmoid#

    -
    +
    -log_sigmoid(x)#
    +class log_sigmoid(x)#

    Applies the Log Sigmoid function.

    Applies \(\log(\sigma(x)) = -\log(1 + e^{-x})\) element wise.

    @@ -833,7 +842,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.log_softmax.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.log_softmax.html index 1b748bdcf..219b2427f 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.log_softmax.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.log_softmax.html @@ -8,7 +8,7 @@ - mlx.nn.log_softmax — MLX 0.10.0 documentation + mlx.nn.log_softmax — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.log_softmax#

    -
    +
    -log_softmax(x, axis=-1)#
    +class log_softmax(x, axis=-1)#

    Applies the Log Softmax function.

    Applies \(x + \log \sum_i e^{x_i}\) element wise.

    @@ -833,7 +842,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.binary_cross_entropy.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.binary_cross_entropy.html index 75d434db0..ff98e136f 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.binary_cross_entropy.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.binary_cross_entropy.html @@ -8,7 +8,7 @@ - mlx.nn.losses.binary_cross_entropy — MLX 0.10.0 documentation + mlx.nn.losses.binary_cross_entropy — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -765,7 +774,7 @@ document.write(` @@ -779,9 +788,9 @@ document.write(`

    mlx.nn.losses.binary_cross_entropy#

    -
    +
    -binary_cross_entropy(inputs: array, targets: array, weights: array | None = None, with_logits: bool = True, reduction: Literal['none', 'mean', 'sum'] = 'mean') array#
    +class binary_cross_entropy(inputs: array, targets: array, weights: array | None = None, with_logits: bool = True, reduction: Literal['none', 'mean', 'sum'] = 'mean')#

    Computes the binary cross entropy loss.

    Parameters:
    @@ -869,7 +878,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.cosine_similarity_loss.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.cosine_similarity_loss.html index 3715855e0..71233a2dc 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.cosine_similarity_loss.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.cosine_similarity_loss.html @@ -8,7 +8,7 @@ - mlx.nn.losses.cosine_similarity_loss — MLX 0.10.0 documentation + mlx.nn.losses.cosine_similarity_loss — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.losses.cosine_similarity_loss#

    -
    +
    -cosine_similarity_loss(x1: array, x2: array, axis: int = 1, eps: float = 1e-08, reduction: Literal['none', 'mean', 'sum'] = 'none') array#
    +class cosine_similarity_loss(x1: array, x2: array, axis: int = 1, eps: float = 1e-08, reduction: Literal['none', 'mean', 'sum'] = 'none')#

    Computes the cosine similarity between the two inputs.

    The cosine similarity loss is given by

    @@ -854,7 +863,7 @@ numerical stability. Default:
    diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.cross_entropy.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.cross_entropy.html index f90e2ba21..4cce5a2ed 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.cross_entropy.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.cross_entropy.html @@ -8,7 +8,7 @@ - mlx.nn.losses.cross_entropy — MLX 0.10.0 documentation + mlx.nn.losses.cross_entropy — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -765,7 +774,7 @@ document.write(` @@ -779,9 +788,9 @@ document.write(`

    mlx.nn.losses.cross_entropy#

    -
    +
    -cross_entropy(logits: array, targets: array, weights: array | None = None, axis: int = -1, label_smoothing: float = 0.0, reduction: Literal['none', 'mean', 'sum'] = 'none') array#
    +class cross_entropy(logits: array, targets: array, weights: array | None = None, axis: int = -1, label_smoothing: float = 0.0, reduction: Literal['none', 'mean', 'sum'] = 'none')#

    Computes the cross entropy loss.

    Parameters:
    @@ -872,7 +881,7 @@ the logits diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.gaussian_nll_loss.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.gaussian_nll_loss.html index 915adee17..d1a31fdc7 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.gaussian_nll_loss.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.gaussian_nll_loss.html @@ -8,7 +8,7 @@ - mlx.nn.losses.gaussian_nll_loss — MLX 0.10.0 documentation + mlx.nn.losses.gaussian_nll_loss — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.losses.gaussian_nll_loss#

    -
    +
    -gaussian_nll_loss(inputs: array, targets: array, vars: array, full: bool = False, eps: float = 1e-06, reduction: Literal['none', 'mean', 'sum'] = 'mean') array#
    +class gaussian_nll_loss(inputs: array, targets: array, vars: array, full: bool = False, eps: float = 1e-06, reduction: Literal['none', 'mean', 'sum'] = 'mean')#

    Computes the negative log likelihood loss for a Gaussian distribution.

    The loss is given by:

    @@ -860,7 +869,7 @@ Default: 1e-6
    diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.hinge_loss.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.hinge_loss.html index 6a976a63f..27c9f12a1 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.hinge_loss.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.hinge_loss.html @@ -8,7 +8,7 @@ - mlx.nn.losses.hinge_loss — MLX 0.10.0 documentation + mlx.nn.losses.hinge_loss — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.losses.hinge_loss#

    -
    +
    -hinge_loss(inputs: array, targets: array, reduction: Literal['none', 'mean', 'sum'] = 'none') array#
    +class hinge_loss(inputs: array, targets: array, reduction: Literal['none', 'mean', 'sum'] = 'none')#

    Computes the hinge loss between inputs and targets.

    \[\text{hinge}(y, y_{\text{pred}}) = \max(0, 1 - y \cdot y_{\text{pred}})\]
    @@ -850,7 +859,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.huber_loss.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.huber_loss.html index 65d0280c0..fc533d8c2 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.huber_loss.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.huber_loss.html @@ -8,7 +8,7 @@ - mlx.nn.losses.huber_loss — MLX 0.10.0 documentation + mlx.nn.losses.huber_loss — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.losses.huber_loss#

    -
    +
    -huber_loss(inputs: array, targets: array, delta: float = 1.0, reduction: Literal['none', 'mean', 'sum'] = 'none') array#
    +class huber_loss(inputs: array, targets: array, delta: float = 1.0, reduction: Literal['none', 'mean', 'sum'] = 'none')#

    Computes the Huber loss between inputs and targets.

    \[\begin{split}l_{\delta}(a) = @@ -856,7 +865,7 @@ Default: 1.0
    diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.kl_div_loss.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.kl_div_loss.html index d41e4c1d3..c821cf03b 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.kl_div_loss.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.kl_div_loss.html @@ -8,7 +8,7 @@ - mlx.nn.losses.kl_div_loss — MLX 0.10.0 documentation + mlx.nn.losses.kl_div_loss — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -765,7 +774,7 @@ document.write(` @@ -779,9 +788,9 @@ document.write(`

    mlx.nn.losses.kl_div_loss#

    -
    +
    -kl_div_loss(inputs: array, targets: array, axis: int = -1, reduction: Literal['none', 'mean', 'sum'] = 'none') array#
    +class kl_div_loss(inputs: array, targets: array, axis: int = -1, reduction: Literal['none', 'mean', 'sum'] = 'none')#

    Computes the Kullback-Leibler divergence loss.

    Computes the following when reduction == 'none':

    mx.exp(targets) * (targets - inputs).sum(axis)
    @@ -852,7 +861,7 @@ document.write(`
       
    diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.l1_loss.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.l1_loss.html index 2c2a67bdc..12f681f3c 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.l1_loss.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.l1_loss.html @@ -8,7 +8,7 @@ - mlx.nn.losses.l1_loss — MLX 0.10.0 documentation + mlx.nn.losses.l1_loss — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -765,7 +774,7 @@ document.write(` @@ -779,9 +788,9 @@ document.write(`

    mlx.nn.losses.l1_loss#

    -
    +
    -l1_loss(predictions: array, targets: array, reduction: Literal['none', 'mean', 'sum'] = 'mean') array#
    +class l1_loss(predictions: array, targets: array, reduction: Literal['none', 'mean', 'sum'] = 'mean')#

    Computes the L1 loss.

    Parameters:
    @@ -847,7 +856,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.log_cosh_loss.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.log_cosh_loss.html index 18496700d..237c2eac6 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.log_cosh_loss.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.log_cosh_loss.html @@ -8,7 +8,7 @@ - mlx.nn.losses.log_cosh_loss — MLX 0.10.0 documentation + mlx.nn.losses.log_cosh_loss — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.losses.log_cosh_loss#

    -
    +
    -log_cosh_loss(inputs: array, targets: array, reduction: Literal['none', 'mean', 'sum'] = 'none') array#
    +class log_cosh_loss(inputs: array, targets: array, reduction: Literal['none', 'mean', 'sum'] = 'none')#

    Computes the log cosh loss between inputs and targets.

    Logcosh acts like L2 loss for small errors, ensuring stable gradients, and like the L1 loss for large errors, reducing sensitivity to outliers. This @@ -855,7 +864,7 @@ dual behavior offers a balanced, robust approach for regression tasks.

    diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.margin_ranking_loss.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.margin_ranking_loss.html index 3baf5d022..523d9a4d8 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.margin_ranking_loss.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.margin_ranking_loss.html @@ -8,7 +8,7 @@ - mlx.nn.losses.margin_ranking_loss — MLX 0.10.0 documentation + mlx.nn.losses.margin_ranking_loss — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.losses.margin_ranking_loss#

    -
    +
    -margin_ranking_loss(inputs1: array, inputs2: array, targets: array, margin: float = 0.0, reduction: Literal['none', 'mean', 'sum'] = 'none') array#
    +class margin_ranking_loss(inputs1: array, inputs2: array, targets: array, margin: float = 0.0, reduction: Literal['none', 'mean', 'sum'] = 'none')#

    Calculate the margin ranking loss that loss given inputs \(x_1\), \(x_2\) and a label \(y\) (containing 1 or -1).

    The loss is given by:

    @@ -869,7 +878,7 @@ Default: 0.0 diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.mse_loss.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.mse_loss.html index f528abcc5..0af00eb11 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.mse_loss.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.mse_loss.html @@ -8,7 +8,7 @@ - mlx.nn.losses.mse_loss — MLX 0.10.0 documentation + mlx.nn.losses.mse_loss — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -765,7 +774,7 @@ document.write(` @@ -779,9 +788,9 @@ document.write(`

    mlx.nn.losses.mse_loss#

    -
    +
    -mse_loss(predictions: array, targets: array, reduction: Literal['none', 'mean', 'sum'] = 'mean') array#
    +class mse_loss(predictions: array, targets: array, reduction: Literal['none', 'mean', 'sum'] = 'mean')#

    Computes the mean squared error loss.

    Parameters:
    @@ -847,7 +856,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.nll_loss.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.nll_loss.html index 04e6697b4..727f5e745 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.nll_loss.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.nll_loss.html @@ -8,7 +8,7 @@ - mlx.nn.losses.nll_loss — MLX 0.10.0 documentation + mlx.nn.losses.nll_loss — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -765,7 +774,7 @@ document.write(` @@ -779,9 +788,9 @@ document.write(`

    mlx.nn.losses.nll_loss#

    -
    +
    -nll_loss(inputs: array, targets: array, axis: int = -1, reduction: Literal['none', 'mean', 'sum'] = 'none') array#
    +class nll_loss(inputs: array, targets: array, axis: int = -1, reduction: Literal['none', 'mean', 'sum'] = 'none')#

    Computes the negative log likelihood loss.

    Parameters:
    @@ -848,7 +857,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.smooth_l1_loss.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.smooth_l1_loss.html index 6e2ac4d89..05fa04ab9 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.smooth_l1_loss.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.smooth_l1_loss.html @@ -8,7 +8,7 @@ - mlx.nn.losses.smooth_l1_loss — MLX 0.10.0 documentation + mlx.nn.losses.smooth_l1_loss — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.losses.smooth_l1_loss#

    -
    +
    -smooth_l1_loss(predictions: array, targets: array, beta: float = 1.0, reduction: Literal['none', 'mean', 'sum'] = 'mean') array#
    +class smooth_l1_loss(predictions: array, targets: array, beta: float = 1.0, reduction: Literal['none', 'mean', 'sum'] = 'mean')#

    Computes the smooth L1 loss.

    The smooth L1 loss is a variant of the L1 loss which replaces the absolute difference with a squared difference when the absolute difference is less @@ -859,7 +868,7 @@ from the squared to the absolute difference. Default:

    diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.triplet_loss.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.triplet_loss.html index 3083abd71..86d0f54fd 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.triplet_loss.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.losses.triplet_loss.html @@ -8,7 +8,7 @@ - mlx.nn.losses.triplet_loss — MLX 0.10.0 documentation + mlx.nn.losses.triplet_loss — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.losses.triplet_loss#

    -
    +
    -triplet_loss(anchors: array, positives: array, negatives: array, axis: int = -1, p: int = 2, margin: float = 1.0, eps: float = 1e-06, reduction: Literal['none', 'mean', 'sum'] = 'none') array#
    +class triplet_loss(anchors: array, positives: array, negatives: array, axis: int = -1, p: int = 2, margin: float = 1.0, eps: float = 1e-06, reduction: Literal['none', 'mean', 'sum'] = 'none')#

    Computes the triplet loss for a set of anchor, positive, and negative samples. Margin is represented with alpha in the math section.

    @@ -860,7 +869,7 @@ Margin is represented with alpha in the math section.

    diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.mish.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.mish.html index 3d3dec6f6..287f6d264 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.mish.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.mish.html @@ -8,7 +8,7 @@ - mlx.nn.mish — MLX 0.10.0 documentation + mlx.nn.mish — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.mish#

    -
    +
    -mish(x: array) array#
    +class mish(x: array)#

    Applies the Mish function, element-wise.

    Mish: A Self Regularized Non-Monotonic Neural Activation Function.

    Reference: https://arxiv.org/abs/1908.08681

    @@ -836,7 +845,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.prelu.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.prelu.html index 79b5e4502..94eca35c6 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.prelu.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.prelu.html @@ -8,7 +8,7 @@ - mlx.nn.prelu — MLX 0.10.0 documentation + mlx.nn.prelu — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.prelu#

    -
    +
    -prelu(x: array, alpha: array) array#
    +class prelu(x: array, alpha: array)#

    Applies the element-wise parametric ReLU.

    \[\text{PReLU}(x) = \max(0,x) + a * \min(0,x)\]
    @@ -835,7 +844,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.relu.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.relu.html index 19e475a72..d13c60a41 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.relu.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.relu.html @@ -8,7 +8,7 @@ - mlx.nn.relu — MLX 0.10.0 documentation + mlx.nn.relu — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -765,7 +774,7 @@ document.write(` @@ -779,9 +788,9 @@ document.write(`

    mlx.nn.relu#

    -
    +
    -relu(x)#
    +class relu(x)#

    Applies the Rectified Linear Unit.

    Simply mx.maximum(x, 0).

    @@ -832,7 +841,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.relu6.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.relu6.html index bd62f11bc..e566481b9 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.relu6.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.relu6.html @@ -8,7 +8,7 @@ - mlx.nn.relu6 — MLX 0.10.0 documentation + mlx.nn.relu6 — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.relu6#

    -
    +
    -relu6(x)#
    +class relu6(x)#

    Applies the Rectified Linear Unit 6.

    Applies \(\min(\max(x, 0), 6)\) element wise.

    @@ -833,7 +842,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.selu.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.selu.html index a92815c0c..1918bcb9c 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.selu.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.selu.html @@ -8,7 +8,7 @@ - mlx.nn.selu — MLX 0.10.0 documentation + mlx.nn.selu — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.selu#

    -
    +
    -selu(x)#
    +class selu(x)#

    Applies the Scaled Exponential Linear Unit.

    \[\begin{split}\text{selu}(x) = \begin{cases} @@ -839,7 +848,7 @@ document.write(`
    diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.sigmoid.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.sigmoid.html index e613a1b5f..abbf030f2 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.sigmoid.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.sigmoid.html @@ -8,7 +8,7 @@ - mlx.nn.sigmoid — MLX 0.10.0 documentation + mlx.nn.sigmoid — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.sigmoid#

    -
    +
    -sigmoid(x)#
    +class sigmoid(x)#

    Applies the sigmoid function.

    \[\text{Sigmoid}(x) = \sigma(x) = \frac{1}{1 + \exp(-x)}\]
    @@ -834,7 +843,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.silu.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.silu.html index a95de605d..89dbaac02 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.silu.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.silu.html @@ -8,7 +8,7 @@ - mlx.nn.silu — MLX 0.10.0 documentation + mlx.nn.silu — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.silu#

    -
    +
    -silu(x)#
    +class silu(x)#

    Applies the Sigmoid Linear Unit. Also known as Swish.

    Applies \(x \sigma(x)\) element wise, where \(\sigma(\cdot)\) is the logistic sigmoid.

    @@ -834,7 +843,7 @@ the logistic sigmoid.

    diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.softmax.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.softmax.html index 65dd5efb9..babf77e4e 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.softmax.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.softmax.html @@ -8,7 +8,7 @@ - mlx.nn.softmax — MLX 0.10.0 documentation + mlx.nn.softmax — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.softmax#

    -
    +
    -softmax(x, axis=-1)#
    +class softmax(x, axis=-1)#

    Applies the Softmax function.

    Applies \(\frac{e^{x_i}}{\sum_j e^{x_j}}\) element wise.

    @@ -833,7 +842,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.softplus.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.softplus.html index 5396d3494..75a786ef3 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.softplus.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.softplus.html @@ -8,7 +8,7 @@ - mlx.nn.softplus — MLX 0.10.0 documentation + mlx.nn.softplus — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.softplus#

    -
    +
    -softplus(x)#
    +class softplus(x)#

    Applies the Softplus function.

    Applies \(\log(1 + \exp(x))\) element wise.

    @@ -833,7 +842,7 @@ document.write(` diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.softshrink.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.softshrink.html index 4a9183874..0b499c1e1 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.softshrink.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.softshrink.html @@ -8,7 +8,7 @@ - mlx.nn.softshrink — MLX 0.10.0 documentation + mlx.nn.softshrink — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.softshrink#

    -
    +
    -softshrink(x, lambd: float = 0.5)#
    +class softshrink(x, lambd: float = 0.5)#

    Applies the Softshrink activation function.

    \[\begin{split}\text{softshrink}(x) = \begin{cases} @@ -838,7 +847,7 @@ x + \lambda & \text{if } x < -\lambda \\
    diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.step.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.step.html index f4551ab9f..ee29c0fd1 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.step.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.step.html @@ -8,7 +8,7 @@ - mlx.nn.step — MLX 0.10.0 documentation + mlx.nn.step — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -766,7 +775,7 @@ document.write(` @@ -780,9 +789,9 @@ document.write(`

    mlx.nn.step#

    -
    +
    -step(x: array, threshold: float = 0.0)#
    +class step(x: array, threshold: float = 0.0)#

    Applies the Step Activation Function.

    This function implements a binary step activation, where the output is set to 1 if the input is greater than a specified threshold, and 0 otherwise.

    @@ -844,7 +853,7 @@ to 1 if the input is greater than a specified threshold, and 0 otherwise.

    diff --git a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.tanh.html b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.tanh.html index c07d4a9da..ae2c6c017 100644 --- a/docs/build/html/python/nn/_autosummary_functions/mlx.nn.tanh.html +++ b/docs/build/html/python/nn/_autosummary_functions/mlx.nn.tanh.html @@ -8,7 +8,7 @@ - mlx.nn.tanh — MLX 0.10.0 documentation + mlx.nn.tanh — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -765,7 +774,7 @@ document.write(` @@ -779,9 +788,9 @@ document.write(`

    mlx.nn.tanh#

    -
    +
    -tanh(x)#
    +class tanh(x)#

    Applies the hyperbolic tangent function.

    Simply mx.tanh(x).

    @@ -832,7 +841,7 @@ document.write(` diff --git a/docs/build/html/python/nn/functions.html b/docs/build/html/python/nn/functions.html index 9d67d5dcc..e655f6cd6 100644 --- a/docs/build/html/python/nn/functions.html +++ b/docs/build/html/python/nn/functions.html @@ -8,7 +8,7 @@ - Functions — MLX 0.10.0 documentation + Functions — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/init.html b/docs/build/html/python/nn/init.html index 45f7f70a7..843c9f25b 100644 --- a/docs/build/html/python/nn/init.html +++ b/docs/build/html/python/nn/init.html @@ -8,7 +8,7 @@ - Initializers — MLX 0.10.0 documentation + Initializers — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/layers.html b/docs/build/html/python/nn/layers.html index 72989f72d..ebb3233d7 100644 --- a/docs/build/html/python/nn/layers.html +++ b/docs/build/html/python/nn/layers.html @@ -8,7 +8,7 @@ - Layers — MLX 0.10.0 documentation + Layers — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -837,43 +846,46 @@ document.write(`

    PReLU([num_parameters, init])

    Applies the element-wise parametric ReLU.

    -

    QuantizedLinear(input_dims, output_dims[, ...])

    +

    QuantizedEmbedding(num_embeddings, dims[, ...])

    +

    The same as Embedding but with a quantized weight matrix.

    + +

    QuantizedLinear(input_dims, output_dims[, ...])

    Applies an affine transformation to the input using a quantized weight matrix.

    -

    RMSNorm(dims[, eps])

    +

    RMSNorm(dims[, eps])

    Applies Root Mean Square normalization [1] to the inputs.

    -

    ReLU()

    +

    ReLU()

    Applies the Rectified Linear Unit.

    -

    RNN(input_size, hidden_size[, bias, ...])

    +

    RNN(input_size, hidden_size[, bias, ...])

    An Elman recurrent layer.

    -

    RoPE(dims[, traditional, base, scale])

    +

    RoPE(dims[, traditional, base, scale])

    Implements the rotary positional encoding.

    -

    SELU()

    +

    SELU()

    Applies the Scaled Exponential Linear Unit.

    -

    Sequential(*modules)

    +

    Sequential(*modules)

    A layer that calls the passed callables in order.

    -

    SiLU()

    +

    SiLU()

    Applies the Sigmoid Linear Unit.

    -

    SinusoidalPositionalEncoding(dims[, ...])

    +

    SinusoidalPositionalEncoding(dims[, ...])

    Implements sinusoidal positional encoding.

    -

    Softshrink([lambd])

    +

    Softshrink([lambd])

    Applies the Softshrink function.

    -

    Step([threshold])

    +

    Step([threshold])

    Applies the Step Activation Function.

    -

    Transformer(dims, num_heads, ...)

    +

    Transformer(dims, num_heads, ...)

    Implements a standard Transformer model.

    -

    Upsample(scale_factor[, mode, align_corners])

    +

    Upsample(scale_factor[, mode, align_corners])

    Upsample the input signal spatially.

    diff --git a/docs/build/html/python/nn/losses.html b/docs/build/html/python/nn/losses.html index 1fd20bd1e..2ba8a0183 100644 --- a/docs/build/html/python/nn/losses.html +++ b/docs/build/html/python/nn/losses.html @@ -8,7 +8,7 @@ - Loss Functions — MLX 0.10.0 documentation + Loss Functions — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/nn/module.html b/docs/build/html/python/nn/module.html index 368b01720..94814cfa5 100644 --- a/docs/build/html/python/nn/module.html +++ b/docs/build/html/python/nn/module.html @@ -8,7 +8,7 @@ - Module — MLX 0.10.0 documentation + Module — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -44,7 +44,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -908,12 +917,12 @@ set by calling

    previous

    -

    mlx.nn.value_and_grad

    +

    mlx.nn.quantize

    - Operations — MLX 0.10.0 documentation + Operations — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -44,7 +44,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -834,45 +843,51 @@ document.write(`

    broadcast_to(a, /, shape, *[, stream])

    Broadcast an array to the given shape.

    -

    ceil(a, /, *[, stream])

    +

    block_masked_mm(a, b, /, block_size, ...)

    +

    Matrix multiplication with block masking.

    + +

    ceil(a, /, *[, stream])

    Element-wise ceil.

    -

    clip(a, /, a_min, a_max, *[, stream])

    +

    clip(a, /, a_min, a_max, *[, stream])

    Clip the values of the array between the given minimum and maximum.

    -

    concatenate(arrays[, axis, stream])

    +

    concatenate(arrays[, axis, stream])

    Concatenate the arrays along the given axis.

    -

    convolve(a, v, /[, mode, stream])

    +

    convolve(a, v, /[, mode, stream])

    The discrete convolution of 1D arrays.

    -

    conv1d(input, weight, /[, stride, padding, ...])

    +

    conv1d(input, weight, /[, stride, padding, ...])

    1D convolution over an input with several channels

    -

    conv2d(input, weight, /[, stride, padding, ...])

    +

    conv2d(input, weight, /[, stride, padding, ...])

    2D convolution over an input with several channels

    -

    conv_general(input, weight, /[, stride, ...])

    +

    conv_general(input, weight, /[, stride, ...])

    General convolution over an input with several channels

    -

    cos(a, /, *[, stream])

    +

    cos(a, /, *[, stream])

    Element-wise cosine.

    -

    cosh(a, /, *[, stream])

    +

    cosh(a, /, *[, stream])

    Element-wise hyperbolic cosine.

    -

    cummax(a, /[, axis, reverse, inclusive, stream])

    +

    cummax(a, /[, axis, reverse, inclusive, stream])

    Return the cumulative maximum of the elements along the given axis.

    -

    cummin(a, /[, axis, reverse, inclusive, stream])

    +

    cummin(a, /[, axis, reverse, inclusive, stream])

    Return the cumulative minimum of the elements along the given axis.

    -

    cumprod(a, /[, axis, reverse, inclusive, stream])

    +

    cumprod(a, /[, axis, reverse, inclusive, stream])

    Return the cumulative product of the elements along the given axis.

    -

    cumsum(a, /[, axis, reverse, inclusive, stream])

    +

    cumsum(a, /[, axis, reverse, inclusive, stream])

    Return the cumulative sum of the elements along the given axis.

    +

    degrees(a, /, *[, stream])

    +

    Convert angles from radians to degrees.

    +

    dequantize(w, /, scales, biases[, ...])

    Dequantize the matrix w using the provided scales and biases and the group_size and bits configuration.

    @@ -1017,30 +1032,36 @@ document.write(`

    negative(a, /, *[, stream])

    Element-wise negation.

    -

    ones(shape[, dtype, stream])

    +

    not_equal(a, b[, stream])

    +

    Element-wise not equal.

    + +

    ones(shape[, dtype, stream])

    Construct an array of ones.

    -

    ones_like(a, /, *[, stream])

    +

    ones_like(a, /, *[, stream])

    An array of ones like the input.

    -

    outer(a, b, /, *[, stream])

    +

    outer(a, b, /, *[, stream])

    Compute the outer product of two 1-D arrays, if the array's passed are not 1-D a flatten op will be run beforehand.

    -

    partition(a, /, kth[, axis, stream])

    +

    partition(a, /, kth[, axis, stream])

    Returns a partitioned copy of the array such that the smaller kth elements are first.

    -

    pad(a, pad_with[, constant_values, stream])

    +

    pad(a, pad_with[, constant_values, stream])

    Pad an array with a constant value

    -

    prod(a, /[, axis, keepdims, stream])

    +

    prod(a, /[, axis, keepdims, stream])

    An product reduction over the given axes.

    -

    quantize(w, /[, group_size, bits, stream])

    +

    quantize(w, /[, group_size, bits, stream])

    Quantize the matrix w using bits bits per element.

    -

    quantized_matmul(x, w, /, scales, biases[, ...])

    +

    quantized_matmul(x, w, /, scales, biases[, ...])

    Perform the matrix multiplication with the quantized matrix w.

    +

    radians(a, /, *[, stream])

    +

    Convert angles from degrees to radians.

    +

    reciprocal(a, /, *[, stream])

    Element-wise reciprocal.

    @@ -1180,12 +1201,12 @@ document.write(` @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.AdaDelta.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.AdaDelta.html index 3b07c3acf..ecfd5a4f3 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.AdaDelta.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.AdaDelta.html @@ -8,7 +8,7 @@ - mlx.optimizers.AdaDelta — MLX 0.10.0 documentation + mlx.optimizers.AdaDelta — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Adafactor.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Adafactor.html index e0f9994a5..7db2fdf17 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Adafactor.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Adafactor.html @@ -8,7 +8,7 @@ - mlx.optimizers.Adafactor — MLX 0.10.0 documentation + mlx.optimizers.Adafactor — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Adagrad.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Adagrad.html index 4f4749656..7f26ce0b9 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Adagrad.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Adagrad.html @@ -8,7 +8,7 @@ - mlx.optimizers.Adagrad — MLX 0.10.0 documentation + mlx.optimizers.Adagrad — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Adam.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Adam.html index d56990b9a..e023f9af5 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Adam.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Adam.html @@ -8,7 +8,7 @@ - mlx.optimizers.Adam — MLX 0.10.0 documentation + mlx.optimizers.Adam — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.AdamW.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.AdamW.html index f02dee856..8e5adc7fb 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.AdamW.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.AdamW.html @@ -8,7 +8,7 @@ - mlx.optimizers.AdamW — MLX 0.10.0 documentation + mlx.optimizers.AdamW — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Adamax.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Adamax.html index cadd80cf6..f222d56b2 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Adamax.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Adamax.html @@ -8,7 +8,7 @@ - mlx.optimizers.Adamax — MLX 0.10.0 documentation + mlx.optimizers.Adamax — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Lion.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Lion.html index cfef41aaf..777de82c4 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Lion.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Lion.html @@ -8,7 +8,7 @@ - mlx.optimizers.Lion — MLX 0.10.0 documentation + mlx.optimizers.Lion — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Optimizer.apply_gradients.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Optimizer.apply_gradients.html index 7315e471b..30c71f959 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Optimizer.apply_gradients.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Optimizer.apply_gradients.html @@ -8,7 +8,7 @@ - mlx.optimizers.Optimizer.apply_gradients — MLX 0.10.0 documentation + mlx.optimizers.Optimizer.apply_gradients — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Optimizer.init.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Optimizer.init.html index 0985a520e..1980334c4 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Optimizer.init.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Optimizer.init.html @@ -8,7 +8,7 @@ - mlx.optimizers.Optimizer.init — MLX 0.10.0 documentation + mlx.optimizers.Optimizer.init — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Optimizer.state.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Optimizer.state.html index a5d3fca2d..a04db3b5c 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Optimizer.state.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Optimizer.state.html @@ -8,7 +8,7 @@ - mlx.optimizers.Optimizer.state — MLX 0.10.0 documentation + mlx.optimizers.Optimizer.state — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Optimizer.update.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Optimizer.update.html index 7f2eaa95a..9f6c8eeac 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Optimizer.update.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.Optimizer.update.html @@ -8,7 +8,7 @@ - mlx.optimizers.Optimizer.update — MLX 0.10.0 documentation + mlx.optimizers.Optimizer.update — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.RMSprop.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.RMSprop.html index 17543d4d0..828d043d7 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.RMSprop.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.RMSprop.html @@ -8,7 +8,7 @@ - mlx.optimizers.RMSprop — MLX 0.10.0 documentation + mlx.optimizers.RMSprop — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.SGD.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.SGD.html index 6e65992f0..37adddc5b 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.SGD.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.SGD.html @@ -8,7 +8,7 @@ - mlx.optimizers.SGD — MLX 0.10.0 documentation + mlx.optimizers.SGD — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.cosine_decay.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.cosine_decay.html index d93ec16b0..9d7308dc0 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.cosine_decay.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.cosine_decay.html @@ -8,7 +8,7 @@ - mlx.optimizers.cosine_decay — MLX 0.10.0 documentation + mlx.optimizers.cosine_decay — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.exponential_decay.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.exponential_decay.html index 8246173bd..6ca0749b3 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.exponential_decay.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.exponential_decay.html @@ -8,7 +8,7 @@ - mlx.optimizers.exponential_decay — MLX 0.10.0 documentation + mlx.optimizers.exponential_decay — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.join_schedules.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.join_schedules.html index cfaf0fd88..df0f2e2cf 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.join_schedules.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.join_schedules.html @@ -8,7 +8,7 @@ - mlx.optimizers.join_schedules — MLX 0.10.0 documentation + mlx.optimizers.join_schedules — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -132,8 +132,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -241,6 +241,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.linear_schedule.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.linear_schedule.html index 6df8bdbf8..3e38bc1cd 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.linear_schedule.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.linear_schedule.html @@ -8,7 +8,7 @@ - mlx.optimizers.linear_schedule — MLX 0.10.0 documentation + mlx.optimizers.linear_schedule — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.step_decay.html b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.step_decay.html index c675e8c23..f87a03068 100644 --- a/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.step_decay.html +++ b/docs/build/html/python/optimizers/_autosummary/mlx.optimizers.step_decay.html @@ -8,7 +8,7 @@ - mlx.optimizers.step_decay — MLX 0.10.0 documentation + mlx.optimizers.step_decay — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/common_optimizers.html b/docs/build/html/python/optimizers/common_optimizers.html index 50c350a69..8dbe784b8 100644 --- a/docs/build/html/python/optimizers/common_optimizers.html +++ b/docs/build/html/python/optimizers/common_optimizers.html @@ -8,7 +8,7 @@ - Common Optimizers — MLX 0.10.0 documentation + Common Optimizers — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/optimizer.html b/docs/build/html/python/optimizers/optimizer.html index 448f9f9a6..5a1627d2d 100644 --- a/docs/build/html/python/optimizers/optimizer.html +++ b/docs/build/html/python/optimizers/optimizer.html @@ -8,7 +8,7 @@ - Optimizer — MLX 0.10.0 documentation + Optimizer — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/optimizers/schedulers.html b/docs/build/html/python/optimizers/schedulers.html index d0e68478a..1e2ba3384 100644 --- a/docs/build/html/python/optimizers/schedulers.html +++ b/docs/build/html/python/optimizers/schedulers.html @@ -8,7 +8,7 @@ - Schedulers — MLX 0.10.0 documentation + Schedulers — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/random.html b/docs/build/html/python/random.html index 853e23ede..837d299a3 100644 --- a/docs/build/html/python/random.html +++ b/docs/build/html/python/random.html @@ -8,7 +8,7 @@ - Random — MLX 0.10.0 documentation + Random — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/transforms.html b/docs/build/html/python/transforms.html index 48c787916..bc31471a1 100644 --- a/docs/build/html/python/transforms.html +++ b/docs/build/html/python/transforms.html @@ -8,7 +8,7 @@ - Transforms — MLX 0.10.0 documentation + Transforms — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/python/tree_utils.html b/docs/build/html/python/tree_utils.html index 935dc768e..e8c1e2651 100644 --- a/docs/build/html/python/tree_utils.html +++ b/docs/build/html/python/tree_utils.html @@ -8,7 +8,7 @@ - Tree Utils — MLX 0.10.0 documentation + Tree Utils — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks @@ -780,13 +789,16 @@ return python trees will be using the default python

    tree_flatten(tree[, prefix, is_leaf])

    -

    Flattens a python tree to a list of key, value tuples.

    +

    Flattens a Python tree to a list of key, value tuples.

    tree_unflatten(tree)

    -

    Recreate a python tree from its flat representation.

    +

    Recreate a Python tree from its flat representation.

    tree_map(fn, tree, *rest[, is_leaf])

    -

    Applies fn to the leaves of the python tree tree and returns a new collection with the results.

    +

    Applies fn to the leaves of the Python tree tree and returns a new collection with the results.

    + +

    tree_map_with_path(fn, tree, *rest[, ...])

    +

    Applies fn to the path and leaves of the Python tree tree and returns a new collection with the results.

    diff --git a/docs/build/html/search.html b/docs/build/html/search.html index 3429309ad..42dc7efd8 100644 --- a/docs/build/html/search.html +++ b/docs/build/html/search.html @@ -6,7 +6,7 @@ - Search - MLX 0.10.0 documentation + Search - MLX 0.12.0 documentation @@ -34,7 +34,7 @@ - + @@ -130,8 +130,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -239,6 +239,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js index 0db2c1d81..ce8232d35 100644 --- a/docs/build/html/searchindex.js +++ b/docs/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["cpp/ops", "dev/extensions", "dev/metal_debugger", "examples/linear_regression", "examples/llama-inference", "examples/mlp", "index", "install", "python/_autosummary/mlx.core.Device", "python/_autosummary/mlx.core.Dtype", "python/_autosummary/mlx.core.DtypeCategory", "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.at", "python/_autosummary/mlx.core.array.cos", "python/_autosummary/mlx.core.array.cummax", "python/_autosummary/mlx.core.array.cummin", "python/_autosummary/mlx.core.array.cumprod", "python/_autosummary/mlx.core.array.cumsum", "python/_autosummary/mlx.core.array.diag", "python/_autosummary/mlx.core.array.diagonal", "python/_autosummary/mlx.core.array.dtype", "python/_autosummary/mlx.core.array.exp", "python/_autosummary/mlx.core.array.flatten", "python/_autosummary/mlx.core.array.item", "python/_autosummary/mlx.core.array.itemsize", "python/_autosummary/mlx.core.array.log", "python/_autosummary/mlx.core.array.log10", "python/_autosummary/mlx.core.array.log1p", "python/_autosummary/mlx.core.array.log2", "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.moveaxis", "python/_autosummary/mlx.core.array.nbytes", "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.squeeze", "python/_autosummary/mlx.core.array.sum", "python/_autosummary/mlx.core.array.swapaxes", "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.atleast_1d", "python/_autosummary/mlx.core.atleast_2d", "python/_autosummary/mlx.core.atleast_3d", "python/_autosummary/mlx.core.broadcast_to", "python/_autosummary/mlx.core.ceil", "python/_autosummary/mlx.core.clip", "python/_autosummary/mlx.core.compile", "python/_autosummary/mlx.core.concatenate", "python/_autosummary/mlx.core.conv1d", "python/_autosummary/mlx.core.conv2d", "python/_autosummary/mlx.core.conv_general", "python/_autosummary/mlx.core.convolve", "python/_autosummary/mlx.core.cos", "python/_autosummary/mlx.core.cosh", "python/_autosummary/mlx.core.cummax", "python/_autosummary/mlx.core.cummin", "python/_autosummary/mlx.core.cumprod", "python/_autosummary/mlx.core.cumsum", "python/_autosummary/mlx.core.default_device", "python/_autosummary/mlx.core.default_stream", "python/_autosummary/mlx.core.dequantize", "python/_autosummary/mlx.core.diag", "python/_autosummary/mlx.core.diagonal", "python/_autosummary/mlx.core.disable_compile", "python/_autosummary/mlx.core.divide", "python/_autosummary/mlx.core.divmod", "python/_autosummary/mlx.core.enable_compile", "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.expm1", "python/_autosummary/mlx.core.eye", "python/_autosummary/mlx.core.fast.layer_norm", "python/_autosummary/mlx.core.fast.rms_norm", "python/_autosummary/mlx.core.fast.rope", "python/_autosummary/mlx.core.fast.scaled_dot_product_attention", "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.isclose", "python/_autosummary/mlx.core.isinf", "python/_autosummary/mlx.core.isnan", "python/_autosummary/mlx.core.isneginf", "python/_autosummary/mlx.core.isposinf", "python/_autosummary/mlx.core.issubdtype", "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.linalg.qr", "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.meshgrid", "python/_autosummary/mlx.core.metal.get_active_memory", "python/_autosummary/mlx.core.metal.get_cache_memory", "python/_autosummary/mlx.core.metal.get_peak_memory", "python/_autosummary/mlx.core.metal.is_available", "python/_autosummary/mlx.core.metal.set_cache_limit", "python/_autosummary/mlx.core.metal.set_memory_limit", "python/_autosummary/mlx.core.metal.start_capture", "python/_autosummary/mlx.core.metal.stop_capture", "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.multivariate_normal", "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.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.std", "python/_autosummary/mlx.core.stop_gradient", "python/_autosummary/mlx.core.stream", "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.tile", "python/_autosummary/mlx.core.topk", "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.utils.tree_flatten", "python/_autosummary/mlx.utils.tree_map", "python/_autosummary/mlx.utils.tree_unflatten", "python/_autosummary/stream_class", "python/array", "python/data_types", "python/devices_and_streams", "python/fast", "python/fft", "python/linalg", "python/metal", "python/nn", "python/nn/_autosummary/mlx.nn.ALiBi", "python/nn/_autosummary/mlx.nn.AvgPool1d", "python/nn/_autosummary/mlx.nn.AvgPool2d", "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.GRU", "python/nn/_autosummary/mlx.nn.GroupNorm", "python/nn/_autosummary/mlx.nn.InstanceNorm", "python/nn/_autosummary/mlx.nn.LSTM", "python/nn/_autosummary/mlx.nn.LayerNorm", "python/nn/_autosummary/mlx.nn.Linear", "python/nn/_autosummary/mlx.nn.MaxPool1d", "python/nn/_autosummary/mlx.nn.MaxPool2d", "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.set_dtype", "python/nn/_autosummary/mlx.nn.Module.state", "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.RNN", "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.Softshrink", "python/nn/_autosummary/mlx.nn.Step", "python/nn/_autosummary/mlx.nn.Transformer", "python/nn/_autosummary/mlx.nn.Upsample", "python/nn/_autosummary/mlx.nn.init.constant", "python/nn/_autosummary/mlx.nn.init.glorot_normal", "python/nn/_autosummary/mlx.nn.init.glorot_uniform", "python/nn/_autosummary/mlx.nn.init.he_normal", "python/nn/_autosummary/mlx.nn.init.he_uniform", "python/nn/_autosummary/mlx.nn.init.identity", "python/nn/_autosummary/mlx.nn.init.normal", "python/nn/_autosummary/mlx.nn.init.uniform", "python/nn/_autosummary_functions/mlx.nn.elu", "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.glu", "python/nn/_autosummary_functions/mlx.nn.hardswish", "python/nn/_autosummary_functions/mlx.nn.leaky_relu", "python/nn/_autosummary_functions/mlx.nn.log_sigmoid", "python/nn/_autosummary_functions/mlx.nn.log_softmax", "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.gaussian_nll_loss", "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.margin_ranking_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.relu6", "python/nn/_autosummary_functions/mlx.nn.selu", "python/nn/_autosummary_functions/mlx.nn.sigmoid", "python/nn/_autosummary_functions/mlx.nn.silu", "python/nn/_autosummary_functions/mlx.nn.softmax", "python/nn/_autosummary_functions/mlx.nn.softplus", "python/nn/_autosummary_functions/mlx.nn.softshrink", "python/nn/_autosummary_functions/mlx.nn.step", "python/nn/_autosummary_functions/mlx.nn.tanh", "python/nn/functions", "python/nn/init", "python/nn/layers", "python/nn/losses", "python/nn/module", "python/ops", "python/optimizers", "python/optimizers/_autosummary/mlx.optimizers.AdaDelta", "python/optimizers/_autosummary/mlx.optimizers.Adafactor", "python/optimizers/_autosummary/mlx.optimizers.Adagrad", "python/optimizers/_autosummary/mlx.optimizers.Adam", "python/optimizers/_autosummary/mlx.optimizers.AdamW", "python/optimizers/_autosummary/mlx.optimizers.Adamax", "python/optimizers/_autosummary/mlx.optimizers.Lion", "python/optimizers/_autosummary/mlx.optimizers.Optimizer.apply_gradients", "python/optimizers/_autosummary/mlx.optimizers.Optimizer.init", "python/optimizers/_autosummary/mlx.optimizers.Optimizer.state", "python/optimizers/_autosummary/mlx.optimizers.Optimizer.update", "python/optimizers/_autosummary/mlx.optimizers.RMSprop", "python/optimizers/_autosummary/mlx.optimizers.SGD", "python/optimizers/_autosummary/mlx.optimizers.cosine_decay", "python/optimizers/_autosummary/mlx.optimizers.exponential_decay", "python/optimizers/_autosummary/mlx.optimizers.join_schedules", "python/optimizers/_autosummary/mlx.optimizers.linear_schedule", "python/optimizers/_autosummary/mlx.optimizers.step_decay", "python/optimizers/common_optimizers", "python/optimizers/optimizer", "python/optimizers/schedulers", "python/random", "python/transforms", "python/tree_utils", "usage/compile", "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", "dev/metal_debugger.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.DtypeCategory.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.at.rst", "python/_autosummary/mlx.core.array.cos.rst", "python/_autosummary/mlx.core.array.cummax.rst", "python/_autosummary/mlx.core.array.cummin.rst", "python/_autosummary/mlx.core.array.cumprod.rst", "python/_autosummary/mlx.core.array.cumsum.rst", "python/_autosummary/mlx.core.array.diag.rst", "python/_autosummary/mlx.core.array.diagonal.rst", "python/_autosummary/mlx.core.array.dtype.rst", "python/_autosummary/mlx.core.array.exp.rst", "python/_autosummary/mlx.core.array.flatten.rst", "python/_autosummary/mlx.core.array.item.rst", "python/_autosummary/mlx.core.array.itemsize.rst", "python/_autosummary/mlx.core.array.log.rst", "python/_autosummary/mlx.core.array.log10.rst", "python/_autosummary/mlx.core.array.log1p.rst", "python/_autosummary/mlx.core.array.log2.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.moveaxis.rst", "python/_autosummary/mlx.core.array.nbytes.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.squeeze.rst", "python/_autosummary/mlx.core.array.sum.rst", "python/_autosummary/mlx.core.array.swapaxes.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.atleast_1d.rst", "python/_autosummary/mlx.core.atleast_2d.rst", "python/_autosummary/mlx.core.atleast_3d.rst", "python/_autosummary/mlx.core.broadcast_to.rst", "python/_autosummary/mlx.core.ceil.rst", "python/_autosummary/mlx.core.clip.rst", "python/_autosummary/mlx.core.compile.rst", "python/_autosummary/mlx.core.concatenate.rst", "python/_autosummary/mlx.core.conv1d.rst", "python/_autosummary/mlx.core.conv2d.rst", "python/_autosummary/mlx.core.conv_general.rst", "python/_autosummary/mlx.core.convolve.rst", "python/_autosummary/mlx.core.cos.rst", "python/_autosummary/mlx.core.cosh.rst", "python/_autosummary/mlx.core.cummax.rst", "python/_autosummary/mlx.core.cummin.rst", "python/_autosummary/mlx.core.cumprod.rst", "python/_autosummary/mlx.core.cumsum.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.diag.rst", "python/_autosummary/mlx.core.diagonal.rst", "python/_autosummary/mlx.core.disable_compile.rst", "python/_autosummary/mlx.core.divide.rst", "python/_autosummary/mlx.core.divmod.rst", "python/_autosummary/mlx.core.enable_compile.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.expm1.rst", "python/_autosummary/mlx.core.eye.rst", "python/_autosummary/mlx.core.fast.layer_norm.rst", "python/_autosummary/mlx.core.fast.rms_norm.rst", "python/_autosummary/mlx.core.fast.rope.rst", "python/_autosummary/mlx.core.fast.scaled_dot_product_attention.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.isclose.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.issubdtype.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.linalg.qr.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.meshgrid.rst", "python/_autosummary/mlx.core.metal.get_active_memory.rst", "python/_autosummary/mlx.core.metal.get_cache_memory.rst", "python/_autosummary/mlx.core.metal.get_peak_memory.rst", "python/_autosummary/mlx.core.metal.is_available.rst", "python/_autosummary/mlx.core.metal.set_cache_limit.rst", "python/_autosummary/mlx.core.metal.set_memory_limit.rst", "python/_autosummary/mlx.core.metal.start_capture.rst", "python/_autosummary/mlx.core.metal.stop_capture.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.multivariate_normal.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.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.std.rst", "python/_autosummary/mlx.core.stop_gradient.rst", "python/_autosummary/mlx.core.stream.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.tile.rst", "python/_autosummary/mlx.core.topk.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.utils.tree_flatten.rst", "python/_autosummary/mlx.utils.tree_map.rst", "python/_autosummary/mlx.utils.tree_unflatten.rst", "python/_autosummary/stream_class.rst", "python/array.rst", "python/data_types.rst", "python/devices_and_streams.rst", "python/fast.rst", "python/fft.rst", "python/linalg.rst", "python/metal.rst", "python/nn.rst", "python/nn/_autosummary/mlx.nn.ALiBi.rst", "python/nn/_autosummary/mlx.nn.AvgPool1d.rst", "python/nn/_autosummary/mlx.nn.AvgPool2d.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.GRU.rst", "python/nn/_autosummary/mlx.nn.GroupNorm.rst", "python/nn/_autosummary/mlx.nn.InstanceNorm.rst", "python/nn/_autosummary/mlx.nn.LSTM.rst", "python/nn/_autosummary/mlx.nn.LayerNorm.rst", "python/nn/_autosummary/mlx.nn.Linear.rst", "python/nn/_autosummary/mlx.nn.MaxPool1d.rst", "python/nn/_autosummary/mlx.nn.MaxPool2d.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.set_dtype.rst", "python/nn/_autosummary/mlx.nn.Module.state.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.RNN.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.Softshrink.rst", "python/nn/_autosummary/mlx.nn.Step.rst", "python/nn/_autosummary/mlx.nn.Transformer.rst", "python/nn/_autosummary/mlx.nn.Upsample.rst", "python/nn/_autosummary/mlx.nn.init.constant.rst", "python/nn/_autosummary/mlx.nn.init.glorot_normal.rst", "python/nn/_autosummary/mlx.nn.init.glorot_uniform.rst", "python/nn/_autosummary/mlx.nn.init.he_normal.rst", "python/nn/_autosummary/mlx.nn.init.he_uniform.rst", "python/nn/_autosummary/mlx.nn.init.identity.rst", "python/nn/_autosummary/mlx.nn.init.normal.rst", "python/nn/_autosummary/mlx.nn.init.uniform.rst", "python/nn/_autosummary_functions/mlx.nn.elu.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.glu.rst", "python/nn/_autosummary_functions/mlx.nn.hardswish.rst", "python/nn/_autosummary_functions/mlx.nn.leaky_relu.rst", "python/nn/_autosummary_functions/mlx.nn.log_sigmoid.rst", "python/nn/_autosummary_functions/mlx.nn.log_softmax.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.gaussian_nll_loss.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.margin_ranking_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.relu6.rst", "python/nn/_autosummary_functions/mlx.nn.selu.rst", "python/nn/_autosummary_functions/mlx.nn.sigmoid.rst", "python/nn/_autosummary_functions/mlx.nn.silu.rst", "python/nn/_autosummary_functions/mlx.nn.softmax.rst", "python/nn/_autosummary_functions/mlx.nn.softplus.rst", "python/nn/_autosummary_functions/mlx.nn.softshrink.rst", "python/nn/_autosummary_functions/mlx.nn.step.rst", "python/nn/_autosummary_functions/mlx.nn.tanh.rst", "python/nn/functions.rst", "python/nn/init.rst", "python/nn/layers.rst", "python/nn/losses.rst", "python/nn/module.rst", "python/ops.rst", "python/optimizers.rst", "python/optimizers/_autosummary/mlx.optimizers.AdaDelta.rst", "python/optimizers/_autosummary/mlx.optimizers.Adafactor.rst", "python/optimizers/_autosummary/mlx.optimizers.Adagrad.rst", "python/optimizers/_autosummary/mlx.optimizers.Adam.rst", "python/optimizers/_autosummary/mlx.optimizers.AdamW.rst", "python/optimizers/_autosummary/mlx.optimizers.Adamax.rst", "python/optimizers/_autosummary/mlx.optimizers.Lion.rst", "python/optimizers/_autosummary/mlx.optimizers.Optimizer.apply_gradients.rst", "python/optimizers/_autosummary/mlx.optimizers.Optimizer.init.rst", "python/optimizers/_autosummary/mlx.optimizers.Optimizer.state.rst", "python/optimizers/_autosummary/mlx.optimizers.Optimizer.update.rst", "python/optimizers/_autosummary/mlx.optimizers.RMSprop.rst", "python/optimizers/_autosummary/mlx.optimizers.SGD.rst", "python/optimizers/_autosummary/mlx.optimizers.cosine_decay.rst", "python/optimizers/_autosummary/mlx.optimizers.exponential_decay.rst", "python/optimizers/_autosummary/mlx.optimizers.join_schedules.rst", "python/optimizers/_autosummary/mlx.optimizers.linear_schedule.rst", "python/optimizers/_autosummary/mlx.optimizers.step_decay.rst", "python/optimizers/common_optimizers.rst", "python/optimizers/optimizer.rst", "python/optimizers/schedulers.rst", "python/random.rst", "python/transforms.rst", "python/tree_utils.rst", "usage/compile.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", "Metal Debugger", "Linear Regression", "LLM inference", "Multi-Layer Perceptron", "MLX", "Build and Install", "mlx.core.Device", "mlx.core.Dtype", "mlx.core.DtypeCategory", "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.at", "mlx.core.array.cos", "mlx.core.array.cummax", "mlx.core.array.cummin", "mlx.core.array.cumprod", "mlx.core.array.cumsum", "mlx.core.array.diag", "mlx.core.array.diagonal", "mlx.core.array.dtype", "mlx.core.array.exp", "mlx.core.array.flatten", "mlx.core.array.item", "mlx.core.array.itemsize", "mlx.core.array.log", "mlx.core.array.log10", "mlx.core.array.log1p", "mlx.core.array.log2", "mlx.core.array.logsumexp", "mlx.core.array.max", "mlx.core.array.mean", "mlx.core.array.min", "mlx.core.array.moveaxis", "mlx.core.array.nbytes", "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.squeeze", "mlx.core.array.sum", "mlx.core.array.swapaxes", "mlx.core.array.tolist", "mlx.core.array.transpose", "mlx.core.array.var", "mlx.core.array_equal", "mlx.core.atleast_1d", "mlx.core.atleast_2d", "mlx.core.atleast_3d", "mlx.core.broadcast_to", "mlx.core.ceil", "mlx.core.clip", "mlx.core.compile", "mlx.core.concatenate", "mlx.core.conv1d", "mlx.core.conv2d", "mlx.core.conv_general", "mlx.core.convolve", "mlx.core.cos", "mlx.core.cosh", "mlx.core.cummax", "mlx.core.cummin", "mlx.core.cumprod", "mlx.core.cumsum", "mlx.core.default_device", "mlx.core.default_stream", "mlx.core.dequantize", "mlx.core.diag", "mlx.core.diagonal", "mlx.core.disable_compile", "mlx.core.divide", "mlx.core.divmod", "mlx.core.enable_compile", "mlx.core.equal", "mlx.core.erf", "mlx.core.erfinv", "mlx.core.eval", "mlx.core.exp", "mlx.core.expand_dims", "mlx.core.expm1", "mlx.core.eye", "mlx.core.fast.layer_norm", "mlx.core.fast.rms_norm", "mlx.core.fast.rope", "mlx.core.fast.scaled_dot_product_attention", "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.isclose", "mlx.core.isinf", "mlx.core.isnan", "mlx.core.isneginf", "mlx.core.isposinf", "mlx.core.issubdtype", "mlx.core.jvp", "mlx.core.less", "mlx.core.less_equal", "mlx.core.linalg.norm", "mlx.core.linalg.qr", "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.meshgrid", "mlx.core.metal.get_active_memory", "mlx.core.metal.get_cache_memory", "mlx.core.metal.get_peak_memory", "mlx.core.metal.is_available", "mlx.core.metal.set_cache_limit", "mlx.core.metal.set_memory_limit", "mlx.core.metal.start_capture", "mlx.core.metal.stop_capture", "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.multivariate_normal", "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.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.std", "mlx.core.stop_gradient", "mlx.core.stream", "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.tile", "mlx.core.topk", "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.utils.tree_flatten", "mlx.utils.tree_map", "mlx.utils.tree_unflatten", "mlx.core.Stream", "Array", "Data Types", "Devices and Streams", "Fast", "FFT", "Linear Algebra", "Metal", "Neural Networks", "mlx.nn.ALiBi", "mlx.nn.AvgPool1d", "mlx.nn.AvgPool2d", "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.GRU", "mlx.nn.GroupNorm", "mlx.nn.InstanceNorm", "mlx.nn.LSTM", "mlx.nn.LayerNorm", "mlx.nn.Linear", "mlx.nn.MaxPool1d", "mlx.nn.MaxPool2d", "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.set_dtype", "mlx.nn.Module.state", "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.RNN", "mlx.nn.ReLU", "mlx.nn.RoPE", "mlx.nn.SELU", "mlx.nn.Sequential", "mlx.nn.SiLU", "mlx.nn.SinusoidalPositionalEncoding", "mlx.nn.Softshrink", "mlx.nn.Step", "mlx.nn.Transformer", "mlx.nn.Upsample", "mlx.nn.init.constant", "mlx.nn.init.glorot_normal", "mlx.nn.init.glorot_uniform", "mlx.nn.init.he_normal", "mlx.nn.init.he_uniform", "mlx.nn.init.identity", "mlx.nn.init.normal", "mlx.nn.init.uniform", "mlx.nn.elu", "mlx.nn.gelu", "mlx.nn.gelu_approx", "mlx.nn.gelu_fast_approx", "mlx.nn.glu", "mlx.nn.hardswish", "mlx.nn.leaky_relu", "mlx.nn.log_sigmoid", "mlx.nn.log_softmax", "mlx.nn.losses.binary_cross_entropy", "mlx.nn.losses.cosine_similarity_loss", "mlx.nn.losses.cross_entropy", "mlx.nn.losses.gaussian_nll_loss", "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.margin_ranking_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.relu6", "mlx.nn.selu", "mlx.nn.sigmoid", "mlx.nn.silu", "mlx.nn.softmax", "mlx.nn.softplus", "mlx.nn.softshrink", "mlx.nn.step", "mlx.nn.tanh", "Functions", "Initializers", "Layers", "Loss Functions", "Module", "Operations", "Optimizers", "mlx.optimizers.AdaDelta", "mlx.optimizers.Adafactor", "mlx.optimizers.Adagrad", "mlx.optimizers.Adam", "mlx.optimizers.AdamW", "mlx.optimizers.Adamax", "mlx.optimizers.Lion", "mlx.optimizers.Optimizer.apply_gradients", "mlx.optimizers.Optimizer.init", "mlx.optimizers.Optimizer.state", "mlx.optimizers.Optimizer.update", "mlx.optimizers.RMSprop", "mlx.optimizers.SGD", "mlx.optimizers.cosine_decay", "mlx.optimizers.exponential_decay", "mlx.optimizers.join_schedules", "mlx.optimizers.linear_schedule", "mlx.optimizers.step_decay", "Common Optimizers", "Optimizer", "Schedulers", "Random", "Transforms", "Tree Utils", "Compilation", "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, 5, 7, 256, 356, 359, 361, 383, 385, 386, 387, 388, 389, 390, 391, 392, 393], "provid": [1, 4, 97, 132, 230, 237, 246, 256, 277, 282, 284, 294, 295, 296, 299, 310, 311, 355, 359, 392, 394], "open": [2, 7, 16, 192, 196], "flexibl": 6, "which": [1, 4, 5, 6, 7, 16, 34, 83, 87, 99, 107, 114, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 132, 138, 139, 140, 141, 143, 146, 147, 149, 163, 170, 184, 187, 188, 198, 199, 202, 203, 204, 205, 206, 218, 219, 226, 237, 239, 240, 259, 264, 265, 267, 275, 277, 281, 303, 331, 334, 338, 341, 356, 369, 370, 383, 386, 387, 388, 389, 393, 394], "user": [1, 4, 256], "mai": [1, 146, 264, 387, 388], "add": [1, 2, 4, 35, 109, 154, 181, 184, 261, 262, 387, 393], "special": 1, "without": [4, 6, 221, 297, 355, 385, 386, 389, 390, 393], "much": [1, 4, 258, 259, 274, 275, 386, 389], "hassl": [], "while": [1, 2, 4, 7, 199, 303, 389, 390], "librari": [1, 7, 256], "suppli": [], "effici": [4, 6, 264, 303, 389, 391], "can": [1, 2, 4, 6, 7, 12, 16, 61, 74, 83, 99, 100, 101, 102, 104, 107, 133, 134, 144, 145, 146, 154, 161, 173, 175, 186, 187, 192, 195, 196, 203, 223, 237, 256, 259, 266, 275, 281, 294, 305, 311, 331, 356, 359, 361, 369, 370, 383, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394], "compos": [6, 256, 386, 387, 391], "ani": [1, 4, 6, 16, 83, 245, 246, 247, 256, 267, 277, 278, 281, 290, 299, 310, 311, 356, 378, 385, 386, 387, 389, 391, 392, 393], "number": [1, 10, 16, 57, 66, 83, 86, 87, 97, 111, 132, 135, 143, 148, 181, 184, 185, 187, 191, 194, 196, 198, 200, 230, 231, 234, 237, 239, 240, 256, 260, 261, 262, 264, 265, 269, 270, 297, 298, 310, 311, 313, 314, 315, 316, 375, 377, 378, 383, 386, 387, 394], "applic": [2, 7], "aris": 390, "case": [1, 4, 118, 121, 122, 124, 125, 126, 127, 128, 147, 159, 199, 218, 259, 264, 275, 309, 341, 347, 352, 353, 369, 370, 386, 387, 391, 392, 393, 394], "where": [5, 111, 137, 184, 237, 240, 258, 259, 260, 261, 262, 263, 264, 265, 267, 268, 269, 270, 271, 272, 273, 274, 275, 281, 298, 300, 301, 309, 315, 316, 320, 321, 322, 323, 332, 338, 344, 347, 349, 353, 370, 387, 388], "new": [1, 5, 80, 99, 174, 177, 199, 219, 233, 246, 289, 297, 359, 361, 372, 377, 386, 388, 389, 390], "function": [1, 2, 3, 4, 5, 6, 14, 83, 102, 105, 106, 132, 137, 143, 146, 147, 159, 209, 237, 239, 240, 244, 246, 256, 267, 276, 278, 282, 289, 294, 298, 301, 302, 304, 305, 306, 308, 309, 310, 321, 322, 323, 324, 325, 327, 328, 343, 348, 350, 351, 352, 353, 354, 356, 361, 370, 383, 385, 388, 389, 390, 392], "highli": 7, "optim": [2, 3, 5, 6, 295, 386, 387, 389], "ar": [1, 3, 4, 5, 6, 7, 14, 16, 76, 80, 82, 83, 87, 88, 99, 107, 111, 117, 118, 120, 121, 123, 124, 126, 127, 128, 132, 137, 138, 139, 140, 141, 142, 143, 146, 147, 149, 159, 169, 180, 181, 182, 184, 185, 186, 187, 188, 192, 195, 196, 205, 206, 218, 219, 226, 237, 239, 240, 245, 246, 250, 260, 261, 262, 263, 264, 265, 269, 270, 272, 273, 284, 297, 299, 311, 329, 331, 332, 355, 359, 368, 370, 385, 386, 387, 388, 389, 390, 391, 392, 393], "need": [1, 4, 5, 6, 76, 184, 256, 295, 296, 307, 310, 383, 387, 389, 390, 391, 393], "For": [1, 4, 7, 35, 115, 142, 146, 184, 247, 256, 260, 264, 277, 282, 291, 294, 299, 303, 307, 311, 313, 314, 315, 316, 356, 383, 386, 387, 388, 389, 390, 391, 392, 393], "you": [1, 2, 4, 5, 6, 7, 256, 307, 310, 356, 383, 386, 387, 388, 390, 392, 393], "design": [3, 6, 383, 393], "your": [1, 4, 7, 359, 387, 389], "own": [7, 390], "link": [1, 7], "top": [1, 232, 273, 311], "core": [1, 2, 3, 4, 5, 256, 258, 259, 260, 270, 274, 275, 284, 287, 289, 292, 311, 312, 313, 314, 315, 316, 317, 318, 319, 329, 331, 338, 356, 359, 361, 386, 390, 391], "we": [1, 3, 4, 5, 97, 184, 185, 256, 266, 305, 366, 368, 383, 385, 386, 387, 389, 393], "inner": 386, "work": [1, 2, 4, 7, 169, 386, 387, 388, 389], "go": [1, 4, 387], "over": [1, 4, 5, 13, 15, 23, 24, 25, 26, 85, 86, 87, 91, 92, 93, 94, 118, 121, 124, 127, 136, 146, 148, 158, 160, 162, 172, 182, 183, 201, 213, 214, 220, 224, 230, 232, 238, 260, 261, 262, 269, 272, 300, 331, 375, 378, 387], "simpl": [1, 4, 5, 256, 266, 355, 386, 387, 389], "learn": [3, 5, 6, 260, 269, 270, 272, 298, 300, 362, 363, 364, 365, 366, 367, 368, 373, 374], "step": [2, 4, 5, 16, 256, 268, 271, 301, 363, 370, 375, 377, 378, 379, 386], "involv": [361, 386], "ad": [1, 3, 7, 112, 270, 359, 362, 363, 364, 365, 366, 367, 373, 389, 392], "let": [1, 3, 4, 386, 387, 389, 390], "": [1, 3, 4, 5, 43, 47, 58, 83, 96, 97, 117, 118, 120, 121, 123, 124, 126, 127, 132, 146, 149, 162, 180, 184, 187, 200, 203, 204, 220, 222, 237, 238, 240, 244, 256, 259, 268, 271, 275, 281, 282, 284, 288, 289, 290, 294, 301, 361, 370, 371, 383, 386, 387, 389, 390, 391, 392, 393], "sai": [1, 4, 356, 389], "would": [1, 4, 311, 388, 389, 390, 393], "like": [1, 4, 6, 142, 179, 243, 265, 337, 370, 372, 386, 387, 389, 390, 391, 393], "an": [1, 2, 4, 5, 7, 9, 13, 15, 27, 77, 78, 79, 80, 85, 86, 87, 107, 111, 112, 115, 128, 131, 135, 146, 149, 169, 174, 178, 179, 181, 183, 184, 185, 198, 199, 200, 215, 218, 225, 226, 227, 230, 231, 234, 240, 242, 243, 245, 246, 256, 258, 259, 263, 269, 271, 272, 273, 274, 275, 277, 297, 298, 299, 301, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 322, 344, 356, 362, 372, 376, 381, 383, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394], "take": [1, 4, 5, 83, 132, 143, 161, 173, 179, 185, 227, 237, 239, 240, 243, 297, 383, 387, 388, 392, 393, 394], "two": [1, 12, 14, 76, 78, 99, 101, 104, 117, 120, 126, 133, 134, 137, 144, 145, 147, 154, 159, 161, 173, 175, 180, 225, 259, 271, 275, 299, 324, 330, 386, 387, 388, 393], "arrai": [1, 4, 5, 6, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 97, 98, 99, 101, 102, 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, 172, 173, 174, 175, 176, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 256, 260, 271, 277, 284, 287, 292, 298, 311, 312, 313, 314, 315, 316, 317, 318, 319, 321, 324, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 353, 356, 359, 362, 363, 364, 365, 366, 367, 368, 373, 374, 375, 376, 377, 378, 379, 386, 387, 389, 390, 391, 393], "x": [1, 3, 4, 5, 35, 105, 110, 112, 113, 135, 146, 185, 188, 200, 205, 209, 235, 236, 241, 246, 256, 258, 259, 260, 267, 269, 270, 272, 273, 274, 275, 276, 277, 298, 300, 302, 307, 309, 311, 320, 321, 322, 323, 324, 325, 326, 327, 328, 341, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 359, 361, 368, 386, 387, 388, 389, 390, 391, 393], "y": [1, 3, 4, 5, 35, 241, 256, 260, 264, 269, 270, 272, 273, 300, 333, 338, 341, 361, 364, 386, 387, 389, 390], "scale": [1, 4, 97, 112, 113, 114, 115, 184, 185, 191, 264, 265, 272, 297, 303, 304, 307, 311, 347, 363], "them": [1, 4, 256, 282, 294, 393], "both": [1, 12, 101, 102, 104, 133, 134, 142, 144, 145, 146, 154, 161, 173, 175, 187, 223, 258, 259, 270, 271, 274, 275, 361, 386, 387, 391, 393], "some": [1, 3, 4, 5, 282, 294, 370, 386, 387, 389], "coeffici": [1, 362, 363, 365, 366, 367, 368], "alpha": [1, 184, 320, 342, 344, 347, 366, 373], "beta": [1, 97, 184, 260, 269, 270, 272, 341, 365, 366, 367, 368], "respect": [1, 3, 5, 112, 113, 132, 184, 237, 246, 256, 260, 267, 269, 270, 272, 359, 387, 391], "togeth": [1, 5, 184, 246], "get": [1, 3, 5, 7, 86, 87, 95, 96, 164, 165, 166, 189, 256, 386, 387, 389, 393], "z": [1, 268, 386, 389], "well": [4, 256, 282, 294, 297, 389], "veri": [4, 297, 389, 393], "easili": [], "do": [1, 4, 7, 256, 283, 294, 356, 359, 366, 386, 387, 389], "just": [1, 5, 272, 386, 388], "write": [1, 4, 256, 390], "out": [1, 7, 258, 259, 264, 265, 274, 275, 291, 386, 387, 388], "follow": [1, 4, 5, 6, 7, 16, 88, 97, 146, 184, 256, 322, 323, 335, 362, 363, 364, 365, 366, 367, 368, 374, 383, 386, 387, 393], "import": [1, 2, 3, 4, 5, 7, 146, 205, 237, 245, 246, 247, 256, 258, 259, 260, 270, 274, 275, 284, 311, 329, 331, 338, 356, 359, 386, 387, 388, 389, 390, 391], "mx": [1, 2, 3, 4, 5, 35, 128, 142, 146, 147, 149, 205, 237, 256, 258, 259, 260, 270, 274, 275, 277, 284, 288, 302, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 326, 329, 330, 331, 335, 338, 345, 354, 356, 359, 361, 383, 386, 387, 388, 389, 390, 391, 392, 393, 394], "def": [1, 3, 4, 5, 237, 256, 359, 386, 387, 388, 389, 390, 393], "simple_axpbi": 1, "float": [1, 10, 14, 16, 73, 112, 113, 114, 115, 130, 131, 137, 142, 146, 185, 186, 191, 250, 260, 263, 264, 265, 269, 270, 272, 277, 289, 300, 303, 307, 309, 310, 311, 312, 313, 314, 315, 316, 318, 319, 330, 331, 332, 334, 338, 341, 342, 352, 353, 362, 363, 364, 365, 366, 367, 368, 373, 374, 375, 376, 378, 379], "return": [1, 3, 4, 5, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 34, 46, 64, 73, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 97, 98, 99, 101, 102, 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, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 165, 168, 169, 170, 172, 173, 174, 175, 176, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 198, 199, 200, 201, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 256, 268, 271, 277, 278, 279, 281, 282, 283, 284, 285, 286, 287, 291, 292, 294, 295, 296, 299, 301, 312, 313, 314, 315, 316, 317, 318, 319, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 356, 359, 369, 385, 386, 387, 388, 389, 390, 392, 393], "thi": [1, 4, 5, 7, 13, 14, 15, 16, 23, 24, 25, 26, 103, 137, 143, 146, 147, 154, 158, 159, 160, 162, 164, 172, 182, 183, 187, 208, 213, 214, 215, 220, 224, 226, 232, 238, 256, 263, 264, 265, 268, 271, 278, 279, 281, 282, 285, 286, 287, 292, 294, 295, 296, 297, 299, 301, 309, 313, 314, 315, 316, 322, 323, 324, 337, 353, 359, 370, 385, 386, 387, 389, 390, 392], "perform": [1, 2, 4, 6, 87, 91, 92, 93, 94, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 159, 185, 200, 213, 226, 256, 269, 310, 315, 316, 386, 388, 389, 393], "leav": [1, 107, 246], "differenti": [1, 6], "howev": [1, 256, 267, 269, 370, 383, 386, 389, 390], "vector": [1, 3, 6, 136, 143, 146, 226, 239, 240, 266, 331, 391], "math": [4, 342, 386], "often": 265, "realiz": [], "axpbi": 1, "routin": 1, "defin": [1, 3, 4, 5, 7, 146, 185, 245, 390], "same": [1, 4, 7, 14, 35, 76, 80, 83, 86, 87, 88, 112, 113, 122, 125, 126, 127, 132, 137, 143, 181, 187, 200, 239, 241, 256, 259, 260, 263, 269, 270, 275, 299, 312, 313, 314, 315, 316, 317, 318, 319, 331, 342, 359, 369, 383, 386, 388, 393], "realli": 272, "part": [1, 387, 388], "doe": [1, 2, 4, 7, 164, 256, 386, 388, 389, 390], "fast": [6, 267, 323, 393], "so": [1, 4, 7, 132, 237, 263, 311, 361, 386, 389, 393], "decid": [246, 281], "want": [4, 387, 393], "reli": 1, "acceler": [1, 260], "framework": [1, 6], "continu": 387, "impos": [], "our": [1, 4, 5, 305, 362, 363, 364, 365, 367, 368], "assumpt": [], "also": [1, 4, 5, 6, 7, 10, 12, 100, 101, 102, 104, 118, 121, 124, 127, 133, 134, 144, 145, 154, 161, 173, 175, 184, 223, 244, 256, 281, 295, 297, 299, 306, 321, 347, 349, 355, 361, 386, 387, 388, 389, 390, 391, 394], "assum": [1, 4, 147, 246, 256, 258, 259, 269, 274, 275], "how": [1, 4, 5, 256, 258, 259, 261, 262, 266, 274, 275, 311, 369, 386, 388, 393], "gradient": [3, 5, 132, 221, 237, 244, 256, 282, 295, 299, 310, 337, 359, 361, 362, 363, 365, 366, 367, 368, 369, 372, 374, 386, 387, 388, 389, 390, 391], "ins": [], "what": [1, 4, 246], "coincid": [], "right": [1, 7, 184, 258, 259, 267, 274, 275, 311, 322, 323, 332, 334, 342], "place": [1, 4, 35, 200, 389, 390], "cours": 387, "The": [1, 2, 4, 5, 6, 7, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 34, 43, 47, 57, 58, 64, 73, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 97, 98, 99, 101, 102, 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, 133, 134, 135, 136, 137, 138, 139, 140, 141, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 165, 166, 168, 169, 170, 172, 173, 174, 175, 176, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 198, 199, 203, 204, 209, 210, 211, 212, 213, 214, 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, 250, 258, 259, 260, 261, 262, 263, 264, 265, 266, 268, 269, 270, 271, 272, 273, 274, 275, 277, 278, 282, 284, 288, 289, 290, 291, 294, 295, 296, 297, 299, 300, 301, 303, 305, 307, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 324, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 353, 356, 359, 361, 362, 363, 364, 365, 366, 367, 368, 371, 373, 374, 375, 378, 381, 386, 387, 388, 389, 390, 391, 392, 393, 394], "structur": [1, 369, 387], "from": [1, 4, 5, 6, 97, 99, 123, 124, 126, 127, 131, 146, 149, 159, 163, 166, 168, 179, 184, 186, 187, 188, 189, 192, 195, 205, 218, 221, 223, 226, 227, 232, 241, 243, 245, 246, 247, 256, 273, 282, 284, 297, 313, 314, 315, 316, 318, 319, 332, 341, 356, 385, 386, 387, 389, 390, 391, 392, 393], "frontend": [], "api": [1, 387], "redirect": 1, "when": [1, 4, 6, 7, 83, 87, 146, 149, 261, 262, 311, 315, 316, 335, 341, 359, 377, 383, 386, 393], "appropri": [1, 386], "fallback": 1, "metal": [1, 6], "vjp": [1, 391], "jvp": [1, 391], "In": [1, 4, 5, 35, 159, 184, 246, 256, 264, 269, 359, 362, 364, 365, 367, 368, 369, 385, 386, 387, 389, 392, 393], "one": [1, 4, 7, 35, 73, 77, 82, 86, 87, 109, 111, 112, 113, 146, 152, 159, 185, 187, 218, 223, 250, 294, 311, 331, 393], "sentenc": [], "comput": [1, 3, 4, 5, 6, 7, 91, 92, 93, 94, 97, 110, 114, 132, 143, 146, 154, 162, 180, 184, 213, 220, 221, 230, 237, 238, 239, 244, 256, 260, 268, 269, 270, 271, 272, 282, 295, 299, 300, 303, 310, 313, 314, 315, 316, 322, 323, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 361, 362, 363, 365, 366, 367, 368, 372, 386, 387, 391, 393], "graph": [1, 4, 5, 6, 387], "rule": 1, "evalu": [1, 4, 5, 6, 107, 143, 239, 256, 280, 291, 359, 361, 386, 391], "said": 4, "start": [1, 3, 4, 6, 7, 16, 114, 148, 170, 215, 386, 388, 393], "discuss": 1, "more": [1, 2, 5, 9, 73, 99, 159, 168, 169, 203, 204, 250, 256, 260, 264, 303, 307, 310, 311, 313, 314, 315, 316, 383, 386, 387, 388, 391, 393], "detail": [1, 9, 168, 256, 264, 303, 307, 311, 313, 314, 315, 316, 362, 364, 365, 367, 368, 388, 391], "thei": [1, 3, 4, 14, 88, 137, 305, 333, 359, 368, 385, 386, 389, 391, 392, 393], "c": [1, 4, 146, 258, 259, 260, 261, 262, 264, 265, 270, 271, 274, 275, 390, 391, 393], "scalar": [1, 12, 14, 27, 46, 73, 76, 80, 82, 101, 102, 104, 130, 131, 132, 133, 134, 137, 144, 145, 146, 148, 154, 155, 156, 157, 159, 161, 173, 175, 181, 186, 192, 195, 196, 203, 223, 237, 241, 244, 342, 387, 389, 391], "i": [1, 2, 4, 5, 6, 7, 14, 16, 25, 34, 73, 82, 85, 86, 87, 88, 91, 92, 93, 94, 98, 99, 102, 107, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 137, 142, 143, 146, 147, 149, 154, 158, 159, 163, 166, 167, 169, 181, 182, 184, 185, 186, 187, 190, 191, 194, 195, 196, 199, 202, 203, 204, 209, 213, 215, 220, 221, 226, 227, 230, 233, 237, 238, 239, 240, 241, 245, 246, 250, 256, 258, 259, 260, 261, 262, 263, 264, 265, 267, 268, 269, 270, 271, 272, 273, 274, 275, 281, 282, 288, 290, 291, 293, 294, 296, 297, 298, 299, 300, 301, 303, 307, 309, 310, 311, 315, 316, 321, 322, 323, 329, 330, 332, 337, 338, 341, 342, 344, 349, 353, 359, 363, 366, 368, 369, 370, 375, 377, 378, 383, 386, 387, 388, 389, 390, 391, 392, 393, 394], "sum": [1, 3, 12, 94, 136, 146, 158, 213, 230, 256, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 388, 390], "element": [1, 11, 12, 17, 18, 19, 20, 21, 22, 25, 66, 81, 89, 90, 91, 92, 93, 94, 97, 101, 102, 104, 105, 106, 108, 110, 111, 129, 130, 133, 134, 137, 138, 139, 140, 141, 144, 145, 150, 151, 152, 153, 154, 155, 156, 157, 161, 163, 173, 175, 176, 182, 184, 185, 197, 198, 201, 209, 210, 211, 212, 216, 217, 223, 226, 228, 229, 232, 237, 241, 263, 264, 265, 268, 271, 276, 298, 301, 303, 325, 327, 328, 343, 344, 346, 349, 350, 351, 386, 387], "wise": [1, 11, 12, 17, 18, 19, 20, 21, 22, 81, 89, 90, 101, 102, 104, 105, 106, 108, 110, 129, 130, 133, 134, 137, 144, 145, 150, 151, 152, 153, 154, 155, 156, 157, 161, 173, 175, 176, 197, 201, 209, 210, 211, 212, 216, 217, 223, 228, 229, 264, 265, 276, 298, 325, 327, 328, 343, 344, 346, 349, 350, 351, 386], "numpi": [1, 4, 5, 6, 12, 14, 16, 80, 101, 102, 104, 133, 134, 137, 144, 145, 154, 159, 161, 173, 175, 223, 389, 391, 392], "style": [1, 12, 14, 101, 102, 104, 133, 134, 137, 144, 145, 154, 159, 161, 173, 175, 223], "broadcast": [1, 12, 14, 80, 82, 101, 102, 104, 131, 133, 134, 137, 144, 145, 154, 159, 161, 173, 175, 186, 187, 190, 195, 196, 223, 227, 241, 297], "between": [1, 6, 82, 128, 310, 330, 333, 334, 337, 377, 389, 393], "input": [1, 3, 4, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 98, 99, 101, 102, 104, 105, 106, 108, 109, 110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 132, 133, 134, 136, 137, 138, 139, 140, 141, 143, 144, 145, 146, 147, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 172, 173, 174, 175, 176, 179, 180, 181, 182, 183, 184, 185, 194, 197, 198, 199, 200, 201, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 235, 236, 237, 238, 240, 241, 243, 258, 259, 260, 261, 262, 264, 265, 266, 268, 269, 270, 271, 272, 273, 274, 275, 297, 299, 300, 301, 303, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 324, 329, 330, 332, 333, 334, 335, 337, 338, 340, 342, 353, 356, 386, 387, 388, 391, 392], "upcast": 1, "const": [1, 332], "factor": [1, 147, 311, 331, 376, 379], "streamordevic": 1, "stream": [1, 6, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 65, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80, 81, 82, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96, 97, 98, 99, 101, 102, 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, 133, 134, 135, 136, 137, 138, 139, 140, 141, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 190, 191, 192, 194, 195, 196, 197, 198, 199, 200, 201, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 238, 241, 242, 243, 393], "schedul": [1, 169, 361, 375, 376, 377, 378, 379, 381, 393], "itself": [1, 370], "call": [1, 2, 4, 5, 28, 130, 256, 266, 282, 294, 305, 359, 361, 370, 386, 387, 389], "other": [1, 4, 6, 142, 146, 256, 283, 359, 368, 386, 388, 389, 391], "within": [2, 25, 137], "simplest": [1, 256], "wai": [1, 4, 7, 256, 311, 386, 387, 388], "about": [1, 4, 5, 389, 393], "term": [1, 332, 362, 363, 364, 365, 366, 367, 373], "exist": [1, 2, 4, 282, 294], "auto": [1, 7], "ax": [1, 13, 15, 23, 24, 74, 109, 117, 118, 120, 121, 123, 124, 126, 127, 128, 136, 146, 158, 160, 162, 172, 181, 183, 213, 218, 220, 224, 225, 230, 233, 238, 387], "multipli": [1, 35, 184, 185, 263, 307, 311], "earlier": 1, "goal": [], "themselv": [1, 386], "contain": [1, 4, 25, 26, 64, 83, 99, 122, 123, 124, 146, 155, 156, 157, 184, 215, 241, 256, 281, 283, 284, 290, 310, 338, 356, 359, 386, 387], "act": [1, 337], "data": [1, 5, 6, 9, 16, 111, 125, 126, 131, 135, 148, 178, 195, 234, 242, 265, 312, 313, 314, 315, 316, 317, 318, 319, 386, 388, 390], "nor": [1, 132, 237], "rather": [1, 387, 393], "easi": [1, 256], "interfac": 1, "block": [1, 4, 310], "A": [1, 4, 6, 7, 8, 64, 76, 83, 112, 113, 115, 132, 143, 146, 147, 149, 158, 159, 160, 172, 184, 186, 187, 188, 190, 191, 192, 195, 196, 215, 219, 222, 237, 239, 240, 244, 245, 246, 247, 248, 256, 260, 264, 268, 269, 270, 272, 281, 285, 286, 289, 295, 296, 300, 305, 307, 310, 313, 314, 316, 323, 342, 343, 359, 361, 365, 367, 369, 370, 372, 377, 386, 387, 389, 390], "It": [1, 4, 7, 132, 208, 237, 256, 296, 299, 369, 381, 390, 392], "creat": [1, 4, 7, 111, 135, 222, 256, 359, 361, 377, 386, 388, 390], "output": [1, 4, 7, 13, 14, 15, 16, 25, 80, 83, 91, 92, 93, 94, 111, 112, 113, 114, 115, 122, 125, 126, 127, 131, 132, 135, 137, 146, 148, 158, 160, 162, 163, 172, 178, 179, 182, 183, 186, 187, 188, 190, 191, 192, 195, 196, 205, 206, 213, 218, 220, 224, 227, 234, 237, 238, 239, 240, 241, 242, 243, 258, 259, 260, 261, 262, 270, 273, 274, 275, 297, 299, 309, 310, 311, 313, 314, 315, 316, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 353, 356, 386, 387, 388, 389, 390, 391, 392, 393], "given": [1, 13, 15, 25, 35, 80, 82, 84, 91, 92, 93, 94, 97, 99, 107, 109, 116, 117, 118, 119, 120, 121, 125, 126, 127, 131, 146, 158, 160, 162, 168, 172, 177, 183, 190, 192, 200, 208, 213, 215, 220, 224, 231, 232, 234, 235, 236, 238, 248, 258, 259, 263, 274, 275, 281, 297, 330, 332, 338], "set": [1, 4, 5, 7, 83, 100, 103, 112, 114, 168, 169, 207, 208, 222, 267, 272, 273, 280, 282, 289, 290, 291, 294, 295, 299, 303, 309, 330, 342, 353, 359, 363, 370, 383, 387, 389], "further": [1, 7, 387], "class": [1, 4, 5, 8, 9, 10, 27, 248, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 331, 359, 362, 363, 364, 365, 366, 367, 368, 373, 374, 381], "under": [1, 146], "These": [1, 83, 227, 331, 393], "word": [], "bit": [97, 184, 185, 250, 277, 299, 300], "abstract": [], "back": [4, 167, 390], "give": [1, 4, 5, 25, 386], "ourselv": [], "concret": [1, 268, 271, 273, 301, 389, 393], "imag": [262, 264, 265, 311], "public": [1, 256], "explicit": [1, 370, 383, 390], "alpha_": 1, "beta_": 1, "must": [1, 2, 7, 82, 131, 146, 186, 187, 190, 192, 195, 196, 241, 311, 390], "know": [1, 4], "popul": 1, "To": [1, 2, 3, 4, 5, 7, 168, 256, 356, 386, 387, 391], "avoid": [1, 289, 386], "unnecessari": [1, 4], "alloc": [1, 165, 168, 169, 359], "respons": 1, "space": [1, 148, 340], "void": 1, "eval_cpu": 1, "std": [1, 318], "overrid": [1, 103], "eval_gpu": 1, "jacobian": [1, 143, 239, 391], "product": [1, 93, 136, 143, 159, 180, 183, 230, 239, 297, 391], "primal": [1, 143, 239], "tangent": [1, 21, 22, 143, 228, 229, 354], "int": [1, 4, 5, 8, 13, 15, 16, 23, 24, 25, 26, 30, 31, 32, 33, 37, 38, 39, 40, 41, 42, 45, 52, 53, 54, 55, 56, 59, 62, 64, 67, 70, 71, 72, 73, 75, 80, 84, 85, 86, 87, 91, 92, 93, 94, 97, 98, 99, 109, 111, 114, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 131, 132, 135, 142, 146, 148, 158, 160, 162, 164, 165, 166, 168, 169, 172, 174, 178, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 198, 199, 200, 213, 214, 215, 218, 219, 220, 224, 225, 226, 227, 230, 231, 232, 233, 234, 235, 236, 237, 238, 240, 242, 248, 256, 258, 259, 260, 261, 262, 266, 268, 269, 270, 271, 272, 273, 274, 275, 297, 299, 300, 301, 303, 307, 310, 324, 330, 331, 335, 340, 342, 359, 375, 377, 378, 379], "argnum": [1, 132, 237, 387], "cotan": 1, "across": [1, 269], "pair": [1, 181, 284, 303], "repres": [1, 4, 338, 342, 390], "axi": [1, 4, 5, 13, 15, 23, 24, 25, 26, 30, 31, 32, 33, 37, 38, 39, 40, 52, 53, 54, 55, 59, 67, 70, 71, 75, 84, 91, 92, 93, 94, 99, 109, 112, 113, 116, 119, 122, 123, 124, 125, 126, 127, 128, 146, 158, 160, 162, 172, 174, 181, 182, 183, 187, 198, 213, 214, 215, 218, 219, 220, 224, 225, 226, 227, 231, 232, 233, 238, 240, 258, 259, 274, 275, 301, 324, 328, 330, 331, 335, 340, 342, 350, 388], "correspond": [1, 13, 15, 73, 82, 97, 99, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 158, 160, 172, 183, 224, 230, 240, 246, 387], "dimens": [1, 4, 13, 15, 23, 24, 58, 64, 73, 77, 78, 79, 83, 86, 87, 99, 109, 114, 123, 124, 126, 127, 128, 136, 146, 147, 158, 159, 160, 162, 172, 183, 184, 187, 194, 220, 224, 227, 230, 233, 238, 260, 261, 262, 264, 265, 268, 269, 270, 271, 272, 297, 300, 301, 303, 310, 311, 324, 331, 386, 387], "vmap": [1, 387, 389, 391], "print": [1, 2, 3, 4, 5, 7, 245, 246, 247, 256, 383, 386, 387, 388, 389, 390, 391], "ostream": 1, "o": [1, 7, 115, 271], "equival": [1, 28, 61, 74, 102, 130, 226, 267, 296, 298, 299, 302, 304, 306, 308], "check": [1, 7, 76, 142, 167, 284, 387, 388], "bool": [1, 13, 14, 15, 23, 24, 30, 31, 32, 33, 37, 38, 39, 40, 52, 53, 54, 55, 59, 71, 73, 75, 76, 83, 87, 91, 92, 93, 94, 114, 137, 142, 146, 149, 158, 160, 162, 163, 167, 169, 170, 172, 183, 185, 220, 224, 238, 260, 261, 262, 268, 269, 270, 271, 272, 273, 277, 281, 282, 284, 289, 291, 294, 297, 299, 301, 303, 307, 310, 311, 329, 332, 363, 374], "is_equival": 1, "privat": 1, "fall": 1, "eval": [1, 2, 3, 4, 5, 256, 359, 361, 386, 387, 389, 391], "deriv": [1, 387, 389], "base": [1, 114, 146, 151, 153, 303, 310, 359, 361, 367, 381, 383, 386, 388], "abov": [1, 4, 184, 235, 256, 311, 366, 387, 388, 389, 393], "demonstr": 390, "treat": [1, 123, 124, 126, 127, 226, 311, 386], "paramet": [1, 3, 4, 5, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 34, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 97, 98, 99, 101, 102, 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, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 168, 169, 170, 172, 173, 174, 175, 176, 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, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 277, 278, 281, 282, 284, 289, 290, 291, 294, 295, 296, 297, 298, 299, 300, 301, 303, 305, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 324, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 353, 355, 356, 359, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 372, 373, 374, 375, 376, 377, 378, 379, 381, 386, 387, 389], "produc": [1, 83, 297, 356], "through": [1, 221, 310, 368, 386, 387, 390], "construct": [1, 5, 41, 98, 131, 178, 231, 242], "its": [1, 7, 159, 182, 194, 234, 244, 247, 256, 299, 365, 366, 367, 390, 393], "type": [1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 34, 64, 73, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 101, 102, 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, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 168, 169, 170, 172, 173, 174, 175, 176, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 194, 195, 196, 197, 198, 199, 200, 201, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 245, 256, 289, 310, 312, 313, 314, 315, 316, 317, 318, 319, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 386, 388], "shape": [1, 2, 4, 5, 61, 76, 80, 83, 85, 86, 87, 99, 115, 116, 119, 122, 125, 126, 127, 131, 143, 159, 178, 179, 186, 187, 188, 190, 191, 192, 195, 196, 199, 227, 239, 241, 242, 243, 256, 258, 259, 260, 261, 262, 264, 265, 268, 270, 271, 273, 274, 275, 284, 301, 312, 313, 314, 315, 316, 317, 318, 319, 331, 342, 361, 386, 387, 388, 391, 393], "pass": [1, 4, 5, 61, 74, 180, 181, 237, 244, 245, 246, 256, 282, 294, 295, 296, 299, 305, 386, 389], "re": [5, 7, 356], "now": [1, 4, 7, 299, 386, 390], "promot": 1, "dtype": [1, 4, 10, 16, 27, 34, 35, 73, 111, 128, 131, 135, 142, 146, 147, 148, 178, 188, 190, 191, 192, 195, 196, 234, 242, 250, 289, 311, 312, 313, 314, 315, 316, 317, 318, 319, 329, 331, 338, 375, 376, 377, 378, 379, 386, 387, 388, 390, 391, 392], "promoted_dtyp": 1, "promote_typ": 1, "float32": [1, 10, 16, 111, 115, 135, 142, 146, 147, 148, 178, 188, 190, 191, 195, 196, 234, 242, 250, 311, 312, 313, 314, 315, 316, 317, 318, 319, 329, 331, 338, 375, 376, 377, 378, 379, 386, 387, 388, 389, 390, 391, 392], "non": [1, 7, 163, 292, 301, 343, 359], "point": [1, 3, 4, 7, 130, 185, 250], "out_dtyp": 1, "is_floating_point": 1, "cast": [1, 34, 125, 126, 127, 149, 277, 289, 390], "up": [1, 4, 299, 386], "determin": [1, 99, 190, 250, 288, 392], "x_cast": 1, "astyp": [1, 4, 277, 390], "y_cast": 1, "broadcasted_input": 1, "broadcast_arrai": 1, "out_shap": 1, "0": [1, 3, 4, 5, 7, 8, 16, 35, 41, 42, 45, 62, 67, 75, 84, 85, 86, 87, 98, 99, 111, 115, 128, 132, 146, 147, 168, 181, 186, 191, 196, 198, 200, 215, 219, 220, 234, 235, 236, 237, 238, 240, 245, 256, 258, 259, 260, 261, 262, 263, 264, 265, 267, 269, 270, 272, 274, 275, 298, 302, 303, 307, 308, 309, 310, 312, 313, 314, 315, 316, 317, 318, 319, 320, 322, 323, 325, 326, 329, 331, 333, 334, 338, 341, 342, 344, 345, 346, 347, 352, 353, 356, 359, 362, 363, 365, 366, 367, 368, 370, 373, 374, 375, 376, 377, 378, 379, 383, 386, 387, 388, 389, 390, 391, 392], "unique_ptr": 1, "make_shar": 1, "to_stream": 1, "handl": [1, 256, 386], "resolv": 1, "No": [1, 4], "happen": [1, 4, 112, 310, 361, 386, 389], "alon": [1, 390], "effect": [264, 386, 389], "onli": [1, 4, 6, 7, 76, 85, 86, 87, 146, 184, 190, 256, 281, 282, 284, 289, 291, 294, 295, 296, 359, 386, 387, 392, 393], "execut": [1, 7, 77, 78, 79, 166, 390, 393], "depend": [1, 2, 3, 73, 146, 268, 271, 301, 388, 392, 393], "devic": [1, 6, 7, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 65, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80, 81, 82, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 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, 133, 134, 135, 136, 137, 138, 139, 140, 141, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 169, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 190, 191, 192, 194, 195, 196, 197, 198, 199, 200, 201, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 238, 241, 242, 243, 248, 393, 394], "specifi": [1, 16, 34, 86, 87, 99, 123, 124, 131, 132, 146, 148, 174, 178, 187, 198, 225, 226, 227, 230, 233, 237, 240, 242, 260, 309, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 353, 387, 393], "memori": [1, 6, 164, 165, 166, 168, 169, 310, 359, 363, 386, 389, 390], "ha": [1, 2, 4, 5, 6, 73, 83, 99, 122, 123, 125, 126, 127, 132, 163, 165, 187, 260, 268, 271, 273, 301, 359, 361, 386, 388, 389, 391, 393], "been": [1, 4, 165, 389], "try": [1, 7], "naiv": [1, 387], "gener": [1, 2, 3, 10, 16, 87, 111, 123, 124, 148, 163, 186, 190, 191, 192, 195, 196, 310, 383, 386, 388, 389, 394], "version": [1, 7, 97, 154, 158, 184, 213, 240, 383, 387, 388], "declar": 1, "member": [1, 256, 287, 292], "method": [1, 4, 8, 9, 10, 27, 248, 256, 288, 359, 362, 363, 364, 365, 366, 367, 368, 370, 373, 374, 381], "each": [1, 64, 97, 107, 114, 142, 159, 163, 181, 184, 185, 187, 198, 205, 206, 215, 231, 233, 240, 241, 264, 265, 266, 268, 269, 271, 301, 303, 310, 329, 331, 383, 386, 389], "find": [1, 3, 7], "pointwis": [], "captur": [1, 2, 83, 170, 171, 256, 386], "templat": 1, "axpby_impl": 1, "typenam": 1, "t": [1, 4, 105, 115, 185, 237, 256, 258, 268, 271, 274, 301, 362, 363, 364, 365, 366, 367, 368, 373, 374, 386, 387, 393], "readi": 1, "fill": [1, 131, 179, 234, 243, 312, 313, 314, 315, 316, 318, 319], "malloc_or_wait": 1, "synchron": [1, 386], "avail": [1, 3, 4, 5, 7, 9, 167, 393], "There": [1, 256, 311, 386], "wait": [1, 4, 169], "here": [1, 4, 386, 387, 389, 392, 393], "request": 1, "pressur": 1, "condit": [1, 241, 393], "set_data": 1, "nbyte": 1, "collect": [1, 246, 385], "pointer": 1, "x_ptr": 1, "y_ptr": 1, "out_ptr": 1, "relev": 1, "static_cast": 1, "size_t": 1, "out_idx": 1, "size": [1, 4, 5, 47, 64, 86, 97, 109, 112, 113, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 131, 135, 142, 146, 165, 169, 184, 185, 187, 199, 215, 218, 256, 258, 259, 261, 262, 266, 270, 274, 275, 299, 311, 363, 389, 390], "map": [1, 5, 35, 149, 246, 266, 277], "linear": [1, 4, 5, 6, 246, 256, 267, 284, 299, 301, 302, 304, 306, 311, 320, 321, 322, 323, 324, 326, 345, 346, 347, 349, 356, 359, 370, 378, 386], "indic": [1, 14, 23, 24, 25, 26, 35, 132, 137, 138, 139, 140, 141, 215, 226, 227, 237, 291, 293, 331, 338, 377, 388], "offset": [1, 4, 42, 99, 112, 114], "x_offset": 1, "elem_to_loc": 1, "stride": [1, 85, 86, 87, 258, 259, 261, 262, 274, 275, 303, 388], "y_offset": 1, "contigu": 1, "regularli": 1, "default": [1, 7, 13, 14, 15, 16, 23, 24, 25, 26, 76, 83, 84, 85, 86, 87, 95, 96, 97, 98, 99, 111, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 132, 135, 137, 146, 147, 148, 149, 158, 160, 162, 163, 168, 169, 172, 178, 182, 183, 184, 185, 186, 187, 188, 190, 191, 192, 194, 195, 196, 198, 199, 200, 207, 208, 214, 215, 218, 219, 220, 222, 224, 230, 232, 233, 234, 235, 236, 237, 238, 240, 242, 250, 258, 259, 260, 261, 262, 268, 270, 271, 273, 274, 275, 277, 282, 284, 289, 291, 294, 297, 298, 299, 301, 303, 307, 308, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 324, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 359, 362, 363, 364, 365, 366, 367, 368, 373, 374, 375, 383, 385, 386, 387, 390, 392, 394], "row": [1, 111, 135, 184, 234], "major": 1, "henc": [1, 184, 386], "doesn": [1, 256], "addit": [1, 4, 12, 112, 113, 115, 149, 260, 269, 272, 297, 300, 359, 387], "abl": [1, 184], "all": [1, 2, 5, 7, 14, 25, 35, 77, 78, 79, 83, 86, 87, 111, 118, 121, 124, 127, 159, 181, 182, 218, 256, 277, 278, 282, 285, 286, 287, 292, 294, 297, 299, 307, 310, 311, 356, 359, 381, 383, 386, 388, 389, 391, 394], "incom": 1, "accordingli": 1, "dispatch": 1, "float16": [1, 10, 149, 250, 277, 389, 390], "bfloat16": [1, 10, 250, 390], "complex64": [1, 250], "throw": [1, 83], "error": [1, 7, 105, 106, 169, 215, 267, 299, 321, 322, 323, 337, 339, 387, 390], "encount": [1, 387], "unexpect": [1, 16], "regist": [1, 5], "op": [1, 180, 282, 389], "assert": 1, "2": [1, 3, 4, 5, 35, 86, 98, 99, 105, 117, 120, 122, 123, 124, 125, 126, 127, 128, 142, 146, 147, 153, 159, 184, 190, 194, 230, 234, 235, 236, 250, 256, 258, 259, 262, 267, 274, 275, 300, 307, 311, 312, 313, 314, 315, 316, 317, 318, 319, 322, 331, 332, 334, 341, 342, 356, 359, 362, 364, 365, 366, 370, 373, 386, 387, 388, 389, 390, 391, 392, 393], "1": [1, 2, 4, 5, 16, 25, 26, 35, 42, 45, 85, 86, 87, 98, 99, 110, 115, 116, 117, 119, 120, 122, 123, 124, 125, 126, 127, 128, 136, 142, 146, 147, 159, 163, 169, 180, 182, 184, 187, 190, 191, 196, 209, 214, 226, 232, 237, 250, 256, 258, 259, 260, 261, 262, 263, 264, 265, 267, 268, 269, 270, 271, 272, 273, 274, 275, 298, 300, 301, 303, 307, 309, 311, 313, 314, 315, 316, 317, 318, 319, 320, 322, 323, 324, 327, 328, 329, 330, 331, 332, 333, 334, 335, 337, 338, 340, 341, 342, 347, 348, 350, 351, 353, 356, 359, 361, 362, 363, 364, 365, 366, 367, 368, 370, 373, 374, 375, 376, 377, 378, 379, 386, 387, 388, 390, 391, 392, 393], "correct": [1, 7, 365, 366, 367, 388, 389], "els": [1, 4, 256, 282, 389], "float16_t": 1, "bfloat16_t": 1, "complex64_t": 1, "runtime_error": 1, "support": [1, 4, 6, 7, 14, 85, 86, 87, 115, 128, 137, 147, 149, 159, 184, 190, 387, 388, 390, 392], "have": [1, 4, 7, 14, 76, 77, 78, 79, 123, 124, 126, 127, 137, 159, 170, 187, 245, 271, 297, 305, 368, 370, 385, 386, 388, 389, 393], "rememb": [], "3": [1, 4, 7, 128, 142, 146, 147, 311, 314, 316, 325, 363, 368, 383, 386, 388, 390, 391], "complic": [], "keep": [1, 13, 15, 23, 24, 158, 160, 162, 172, 183, 220, 224, 238, 256, 281, 387, 389], "mind": [1, 4], "half": [1, 16, 192, 196, 303, 389], "precis": [1, 4, 110, 115, 256, 267, 300, 369, 386], "direct": [1, 4, 279, 368, 393], "fix": [1, 4, 7, 389], "possibli": [4, 159], "due": [], "transpos": [4, 28, 185], "aren": [], "guarante": [], "fit": [1, 184, 393], "requir": [1, 4, 256, 389, 390], "column": [1, 111, 135, 184], "inplac": 1, "expect": [1, 4, 261, 262, 263, 264, 265, 307, 310, 332, 386, 388], "answer": [], "copi": [1, 4, 6, 182, 214, 390], "simpli": [1, 4, 7, 302, 320, 326, 345, 354, 359, 386, 387], "catlas_saxpbi": 1, "axpby_impl_acceler": 1, "first": [1, 2, 3, 4, 5, 7, 99, 128, 132, 155, 157, 159, 182, 194, 225, 230, 237, 245, 256, 259, 269, 275, 311, 330, 338, 363, 365, 366, 367, 370, 386, 387, 390, 393], "mode": [1, 88, 280, 291, 293, 311, 315, 316], "e": [1, 5, 7, 105, 143, 209, 260, 261, 262, 264, 265, 269, 270, 272, 282, 300, 327, 328, 350, 355, 361, 364, 386, 389, 394], "match": [7, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 164, 284, 311, 331, 388, 390], "transposit": [], "data_s": [], "items": [], "flag": [1, 386, 390], "copy_inplac": 1, "copytyp": 1, "n": [1, 4, 27, 85, 86, 87, 111, 116, 118, 119, 121, 122, 125, 127, 135, 190, 220, 234, 238, 258, 259, 260, 261, 262, 264, 265, 268, 271, 274, 275, 301, 311, 337, 342], "incx": 1, "inci": 1, "great": 2, "But": 393, "criteria": 1, "luckili": 389, "alwai": [164, 245, 387], "With": 1, "final": [1, 3, 4, 5, 378], "singl": [1, 5, 107, 143, 149, 163, 181, 239, 259, 275, 386, 388, 392], "row_contigu": 1, "col_contigu": 1, "common": [1, 361, 386, 389], "hit": 1, "mileston": [], "enough": [1, 389], "run": [1, 2, 4, 5, 6, 7, 8, 180, 248, 260, 277, 362, 363, 365, 366, 367, 386, 389, 393, 394], "If": [1, 4, 7, 13, 14, 15, 16, 23, 24, 25, 26, 73, 76, 82, 84, 88, 91, 92, 93, 94, 98, 99, 107, 112, 114, 125, 126, 127, 130, 131, 132, 137, 146, 149, 158, 159, 160, 162, 163, 168, 169, 172, 178, 181, 182, 183, 187, 190, 198, 213, 214, 215, 220, 224, 226, 227, 230, 232, 237, 238, 240, 242, 246, 260, 261, 262, 269, 272, 273, 282, 284, 294, 299, 301, 303, 305, 307, 311, 329, 331, 342, 363, 386, 387, 389, 392, 393, 394], "plan": [1, 386], "stop": [1, 4, 16, 148, 171, 221, 387, 388], "enjoi": 1, "speed": 1, "appl": [1, 4, 6, 7, 393], "silicon": [1, 4, 6, 7, 393], "address": 1, "shade": 1, "languag": 1, "kernel": [1, 85, 86, 87, 258, 259, 274, 275, 386, 388], "written": 1, "help": [1, 4, 386, 393], "resourc": 1, "walkthrough": 1, "pipelin": 1, "specif": [1, 7, 387], "cpp": 1, "algorithm": [311, 368], "launch": [1, 388], "exactli": [1, 4, 284, 387], "mani": [1, 215, 261, 262, 266, 386, 389], "thread": 1, "pick": 1, "updat": [1, 3, 4, 5, 35, 83, 246, 260, 277, 278, 284, 289, 290, 291, 296, 361, 363, 366, 368, 369, 370, 374, 375, 376, 377, 378, 379, 386, 389], "assign": [1, 35, 359], "axpby_gener": 1, "buffer": [1, 164, 390], "constant": [1, 4, 7, 112, 113, 181, 256, 260, 269, 272, 300, 332, 342, 373, 375, 386, 390], "4": [1, 4, 97, 128, 146, 184, 185, 205, 250, 258, 259, 260, 270, 274, 275, 299, 310, 311, 313, 314, 315, 329, 386, 388, 391, 393], "5": [1, 3, 4, 7, 146, 169, 186, 258, 260, 263, 264, 265, 270, 274, 308, 311, 312, 315, 316, 341, 352, 356, 373, 375, 376, 386, 387, 388], "x_stride": 1, "6": [1, 4, 146, 205, 310, 314, 322, 323, 325, 332, 342, 346, 373, 386, 388, 391], "y_stride": 1, "7": [1, 4, 146, 184, 388], "ndim": [1, 128, 146, 311], "8": [1, 4, 7, 146, 184, 250, 259, 270, 275, 310, 330, 362, 363, 364, 365, 366, 367, 373, 386, 388, 391, 393], "uint": 1, "index": [1, 6, 8, 25, 35, 109, 111, 132, 163, 182, 226, 227, 237, 248], "thread_position_in_grid": 1, "convert": [1, 73, 77, 78, 79, 128, 299, 389, 390, 391], "instanti": [1, 5, 389], "uniqu": [1, 383], "host": 1, "name": [1, 149, 184, 185, 203, 204, 205, 206, 256, 269, 281, 284, 286, 388, 392], "identifi": [1, 245, 385], "instantiate_axpbi": 1, "type_nam": 1, "host_nam": 1, "axpby_general_": 1, "compil": [2, 6, 7, 100, 103, 387, 389], "mlx_ext": 1, "metallib": [1, 7], "see": [1, 4, 5, 7, 9, 10, 29, 30, 31, 32, 33, 36, 37, 38, 39, 40, 42, 44, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 65, 67, 68, 69, 70, 71, 72, 74, 75, 146, 168, 203, 204, 250, 256, 260, 264, 267, 280, 298, 299, 302, 303, 304, 306, 307, 308, 311, 313, 314, 315, 316, 321, 322, 323, 347, 386, 387, 388, 391, 393], "later": [2, 7], "co": [1, 307, 387], "locat": [1, 295, 296, 393], "share": [6, 97, 184, 185], "register_librari": 1, "potenti": 169, "path": [2, 7, 170, 205, 206, 284], "tri": [], "load": [5, 6, 284], "hasn": [], "alreadi": [1, 2, 4], "static": 7, "object": [2, 9, 27, 46, 73, 83, 142, 205, 240, 245, 246, 250, 264, 310, 385], "why": 4, "packag": [1, 3, 5, 356], "process": [4, 87, 88, 246, 265, 266, 310, 385], "logic": [1, 155, 156, 157], "grid": [1, 163], "shown": 1, "below": [1, 7, 146, 234, 236, 250, 311, 389], "prepar": [1, 4], "carri": 1, "should": [1, 3, 4, 5, 7, 99, 112, 113, 115, 143, 170, 184, 227, 237, 239, 245, 256, 261, 262, 264, 265, 291, 297, 305, 331, 333, 338, 359, 385, 386, 387, 389, 390, 394], "d": [1, 4, 98, 99, 136, 146, 159, 163, 180, 226, 234, 235, 236, 247, 265, 268, 271, 301, 362, 365, 367, 393], "ostringstream": 1, "kname": 1, "axpby_": 1, "general_": 1, "type_to_nam": 1, "make": [1, 2, 4, 5, 7, 159, 177, 208, 256, 375, 376, 378, 379, 386, 389, 391, 393], "sure": [1, 2, 4, 7, 256, 386], "look": [1, 4], "folder": 1, "get_colocated_mtllib_path": 1, "get_kernel": 1, "str": [1, 88, 132, 146, 149, 163, 170, 202, 203, 204, 205, 206, 237, 245, 247, 277, 278, 281, 282, 284, 286, 288, 294, 311, 315, 316, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342], "encod": [1, 114, 303, 307, 310, 331], "compute_encod": 1, "get_command_encod": 1, "setcomputepipelinest": 1, "those": [1, 4, 256], "nelem": 1, "set_array_buff": 1, "setbyt": 1, "sizeof": 1, "threadgroup": 1, "higher": [1, 136, 338, 387], "than": [1, 4, 73, 88, 99, 102, 114, 133, 134, 144, 145, 159, 168, 246, 303, 309, 311, 338, 341, 353, 363, 368, 386, 387, 393], "max": [1, 146, 161, 274, 275, 298, 325, 330, 332, 333, 338, 342, 344, 346, 363, 367, 386, 387, 393], "allow": [1, 142, 256, 296, 359, 381, 388, 391], "tgp_size": 1, "min": [1, 146, 173, 298, 325, 344, 346], "maxtotalthreadsperthreadgroup": 1, "3d": [1, 260, 265, 311], "mtl": 1, "group_dim": 1, "grid_dim": 1, "divid": [1, 35, 130, 184], "among": 1, "dispatchthread": 1, "few": [1, 4, 5, 6, 389, 391], "thing": [1, 4], "note": [1, 4, 7, 14, 83, 85, 86, 115, 123, 124, 137, 146, 164, 184, 187, 256, 300, 311, 390, 392], "befor": [1, 4, 7, 25, 182, 281, 310, 370, 388, 389], "move": [1, 174, 393], "track": [1, 256, 260], "activ": [1, 7, 164, 264, 309, 310, 343, 352, 353, 355, 386], "u": [1, 273, 296, 381, 389], "command": [1, 2, 7], "instead": [1, 7, 256, 296, 307, 387, 389], "end_encod": 1, "end": [99, 167, 184, 259, 268, 271, 275, 309, 334, 341, 347, 352, 353, 378], "until": [1, 389, 391], "limit": [1, 82, 168, 169, 388], "flush": 1, "enqueu": [], "commit": [], "associ": [1, 205, 206, 389], "suggest": [], "deeper": [], "dive": [], "studi": [], "come": [1, 4, 387], "far": 361, "built": [1, 7, 389], "includ": [1, 91, 92, 93, 94, 164, 165, 169, 272, 278, 290, 299, 332, 386, 387, 388, 391, 392, 394], "forward": [1, 237, 386, 389], "diff": 1, "push": 1, "along": [1, 23, 24, 83, 84, 91, 92, 93, 94, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 146, 198, 213, 215, 219, 226, 227, 230, 231, 232, 256, 301, 324], "similarli": [1, 7, 159, 387, 389], "scale_arr": 1, "contribut": 1, "tangent_x": 1, "tangent_i": 1, "revers": [1, 37, 38, 39, 40, 91, 92, 93, 94, 233, 307], "arg": [1, 4, 9, 10, 107, 205, 206], "push_back": 1, "fulli": [1, 6, 386, 390, 393], "overal": 1, "directori": [1, 4, 7], "extens": [1, 149, 170, 288, 392], "h": [1, 85, 86, 146, 259, 260, 262, 264, 265, 268, 271, 275, 301, 387, 389], "mlx_sample_extens": 1, "__init__": [1, 4, 5, 8, 9, 10, 27, 248, 256, 359], "py": [1, 4, 7], "cmakelist": 1, "txt": 1, "setup": [1, 3, 5, 7, 386], "hold": [1, 4, 9, 10, 146, 386], "instal": 1, "pybind11": [], "sinc": [1, 4, 5, 359, 368, 377, 390, 393], "compon": [1, 4], "etc": [1, 184, 256, 311], "pybind11_modul": [], "m": [1, 4, 7, 111, 146, 234, 258, 259, 274, 275, 362, 386], "doc": [1, 5], "sampl": [1, 3, 4, 148, 186, 187, 188, 190, 192, 195, 196, 313, 314, 315, 316, 318, 319, 332, 338, 342, 383, 386], "_a": 1, "pos_onli": [], "kw_onli": 1, "none": [1, 4, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 65, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 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, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 171, 172, 173, 174, 175, 176, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 204, 205, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 240, 241, 242, 243, 245, 246, 248, 258, 259, 267, 274, 275, 277, 281, 282, 289, 294, 297, 301, 307, 310, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 363, 381, 388], "r": [1, 4, 147, 237, 264, 268], "pbdoc": [], "most": [1, 187, 256, 372, 386, 387, 388, 389], "complex": [1, 123, 124, 125, 126, 127, 245, 250, 256, 296, 386, 387], "bell": 1, "whistl": 1, "liter": [1, 311, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342], "string": [1, 390, 392], "modul": [1, 4, 5, 244, 299, 305, 310, 356, 372, 385, 386, 389], "ensur": [1, 7, 337], "caster": 1, "find_packag": 1, "config": 1, "add_librari": 1, "sourc": [1, 2, 56, 174, 233], "target_sourc": 1, "cmake_current_list_dir": 1, "header": 1, "target_include_directori": 1, "target_link_librari": 1, "attach": 1, "conveni": [1, 5, 142], "mlx_build_metallib": 1, "target": [1, 237, 329, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 386], "destin": [1, 56, 174], "automat": [1, 6, 149, 391, 392, 393], "practic": [1, 386], "mlx_build_met": [1, 7], "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": [], "build_shared_lib": 1, "target_link_opt": 1, "wl": 1, "rpath": 1, "loader_path": 1, "onc": [1, 386], "describ": [1, 389], "util": [1, 4, 6, 7, 205, 256], "__name__": [1, 4], "__main__": [1, 4], "descript": [1, 4, 250], "ext_modul": 1, "cmakeextens": 1, "cmdclass": 1, "build_ext": 1, "cmakebuild": 1, "package_dir": [], "package_data": 1, "dylib": 1, "zip_saf": 1, "fals": [1, 4, 13, 14, 15, 23, 24, 30, 31, 32, 33, 37, 38, 39, 40, 52, 53, 54, 55, 59, 71, 75, 76, 83, 87, 91, 92, 93, 94, 137, 142, 146, 149, 158, 160, 162, 163, 169, 172, 183, 220, 224, 238, 241, 245, 246, 250, 269, 270, 272, 273, 282, 284, 294, 297, 299, 303, 307, 310, 311, 329, 332, 363, 374, 390], "python_requir": 1, "even": [1, 4, 83, 386, 389, 390], "though": [1, 4, 386, 389, 390], "j8": 1, "libmlx_ext": 1, "cpython": 1, "3x": 1, "darwin": 1, "pip": [1, 7], "after": [1, 4, 5, 25, 128, 130, 182, 184, 260, 269, 272, 277, 278, 282, 284, 291, 294, 295, 296, 297, 310, 341, 386, 393], "plai": [1, 4], "ones": [1, 4, 179, 205, 234, 295, 296, 299, 388], "b": [1, 2, 4, 12, 14, 76, 101, 102, 104, 130, 133, 134, 136, 137, 144, 145, 146, 154, 155, 157, 159, 161, 173, 175, 180, 184, 223, 230, 237, 273, 301, 311, 324, 387, 388, 389, 390, 391, 392, 393], "f": [1, 2, 3, 5, 146, 256, 271, 366, 386, 390], "item": [1, 3, 4, 5, 246, 389, 390, 391], "true": [1, 3, 4, 14, 37, 38, 39, 40, 76, 83, 91, 92, 93, 94, 114, 137, 142, 146, 149, 163, 169, 185, 213, 241, 245, 246, 250, 256, 260, 261, 262, 268, 269, 270, 271, 272, 273, 281, 282, 284, 291, 294, 299, 301, 303, 307, 310, 311, 329, 337, 363], "quick": [1, 6], "benchmark": [1, 386], "compar": [1, 76, 386], "time": [1, 4, 7, 169, 231, 256, 258, 259, 268, 271, 274, 275, 301, 386, 387, 389, 393], "set_default_devic": 1, "256": [1, 5], "512": [1, 2, 4, 310, 393], "random": [1, 2, 3, 4, 5, 6, 258, 259, 260, 270, 274, 275, 284, 291, 386, 387, 393, 394], "normal": [1, 3, 4, 112, 113, 190, 195, 256, 258, 259, 260, 269, 270, 272, 274, 275, 300, 310, 313, 315, 390, 393], "bench": 1, "warm": [1, 386], "rang": [1, 2, 3, 4, 5, 7, 16, 128, 148, 314, 316, 322, 323, 361, 375, 376, 377, 378, 379, 383, 386, 387, 389, 393], "100": [1, 3, 4, 378, 386, 387, 389, 393], "5000": 1, "simple_tim": 1, "custom_tim": 1, "3f": [1, 5, 386], "custom": [1, 310], "114": 1, "109": 1, "modest": 1, "improv": [1, 2, 4, 362, 363, 364, 365, 366, 367, 373, 386], "awai": [1, 4], "good": [1, 7, 386, 393], "nn": [1, 4, 5, 205, 246, 256, 356, 359, 361, 370, 372, 386, 389], "grad": [1, 3, 5, 237, 361, 369, 386, 387, 388, 389, 391], "full": [1, 5, 61, 74, 88, 213, 295, 296, 332, 386, 389], "profil": 2, "kei": [2, 4, 115, 186, 187, 188, 190, 191, 192, 194, 195, 196, 245, 246, 281, 282, 294, 297, 370, 383, 385, 387], "build": [2, 4, 6, 315, 359, 386], "mlx_metal_debug": [2, 7], "option": [2, 4, 13, 15, 16, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 65, 67, 68, 69, 70, 71, 72, 74, 75, 77, 78, 79, 83, 84, 85, 86, 87, 88, 91, 92, 93, 94, 97, 98, 99, 111, 112, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 131, 132, 135, 140, 141, 146, 147, 148, 149, 158, 160, 162, 163, 169, 172, 178, 181, 182, 183, 184, 185, 186, 187, 188, 190, 191, 192, 194, 195, 196, 198, 199, 213, 214, 215, 218, 219, 220, 224, 226, 230, 232, 233, 234, 235, 236, 237, 238, 240, 242, 245, 246, 258, 259, 260, 261, 262, 268, 271, 273, 274, 275, 277, 281, 282, 284, 289, 294, 297, 299, 301, 303, 307, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 362, 363, 364, 365, 366, 367, 368, 370, 373, 374, 375, 383, 386, 392, 394], "debug": 2, "record": [2, 166, 389], "dure": [2, 83, 263, 264, 265, 311, 390], "inspect": [2, 386, 391], "label": [2, 3, 331, 338], "queue": 2, "readabl": 2, "start_captur": 2, "initi": [2, 3, 4, 256, 260, 269, 270, 272, 273, 298, 300, 312, 313, 314, 315, 316, 317, 318, 319, 359, 370, 375, 376, 378, 379, 386, 389], "gpu": [2, 6, 386, 388, 393], "main": [6, 99, 111, 246, 256], "jane": [], "develop": [6, 7], "gputrac": [2, 170], "arang": [146, 250, 311, 388, 390], "10": [2, 4, 5, 151, 200, 205, 246, 256, 284, 356, 377, 379, 386, 388], "20": 146, "30": 363, "40": [], "stop_captur": 2, "replai": 2, "trace": [2, 386], "view": [2, 390], "overview": 2, "oper": [2, 4, 6, 8, 34, 77, 78, 79, 87, 115, 213, 221, 227, 248, 256, 310, 368, 386, 387, 388, 389, 390, 391, 393, 394], "checkout": [2, 386], "document": [2, 6, 61, 74, 203, 204, 250, 386, 387, 388], "inform": [2, 4, 5, 7, 203, 204, 250, 256, 260, 267, 297, 387, 393], "skip": 2, "save": [2, 4, 6, 149, 170, 184, 203, 204, 205, 206, 288, 389], "project": [2, 4, 297], "us": [2, 3, 4, 5, 6, 7, 16, 35, 97, 100, 102, 114, 128, 146, 147, 159, 164, 165, 166, 168, 184, 185, 198, 199, 245, 250, 256, 259, 264, 266, 267, 268, 271, 273, 275, 277, 281, 288, 295, 297, 299, 301, 303, 307, 310, 311, 315, 316, 322, 323, 330, 356, 359, 361, 362, 363, 365, 366, 367, 368, 369, 370, 383, 385, 386, 387, 388, 391, 393], "cmake": [2, 7], "mkdir": [2, 7], "cd": [2, 7], "dmlx_metal_debug": 2, "ON": [2, 7], "g": [2, 7, 146, 184, 271, 355, 373, 374, 389, 394], "xcodeproj": 2, "select": [2, 7, 232, 241, 277, 281, 289], "metal_captur": 2, "exampl": [2, 3, 4, 5, 16, 35, 128, 146, 147, 222, 226, 256, 258, 259, 260, 270, 274, 275, 282, 284, 291, 294, 311, 312, 313, 314, 315, 316, 317, 318, 319, 329, 331, 338, 356, 361, 370, 375, 376, 377, 378, 379, 383, 387, 388, 389, 390, 391, 392], "schema": 2, "implement": [3, 5, 114, 115, 146, 266, 281, 297, 303, 305, 307, 309, 310, 311, 353, 362, 363, 364, 365, 367, 368, 369, 381, 386, 387, 390], "basic": [3, 200, 387], "model": [3, 5, 6, 205, 244, 246, 256, 277, 280, 282, 284, 288, 291, 293, 294, 295, 297, 310, 356, 359, 361, 369, 370, 372, 386, 389], "problem": [3, 5, 256], "metadata": [3, 149, 203, 204], "num_featur": [3, 260], "num_exampl": 3, "1_000": 3, "num_it": 3, "10_000": 3, "iter": [3, 5, 246, 383, 386, 389], "sgd": [3, 5, 361, 368, 370, 375, 376, 379, 386], "lr": [3, 368], "01": [3, 326, 366], "rate": [3, 362, 363, 364, 365, 366, 367, 368, 373, 374], "ll": [3, 5, 334, 386, 387], "synthet": 3, "dataset": [3, 389], "matrix": [3, 41, 97, 98, 111, 135, 146, 147, 159, 163, 184, 185, 190, 299, 317, 356], "ground": [3, 4, 331, 341], "truth": [3, 331, 341], "w_star": 3, "valu": [3, 4, 11, 14, 16, 23, 24, 46, 73, 76, 82, 111, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 131, 137, 146, 148, 181, 186, 187, 188, 190, 191, 192, 195, 196, 203, 226, 227, 237, 240, 244, 245, 246, 250, 259, 263, 264, 265, 270, 273, 275, 281, 297, 298, 308, 309, 310, 312, 329, 330, 331, 332, 333, 334, 336, 337, 338, 339, 340, 341, 353, 359, 363, 366, 375, 376, 378, 379, 387], "gaussian": [3, 267, 321, 322, 323, 332], "nois": 3, "noisi": 3, "ep": [3, 112, 113, 260, 269, 270, 272, 300, 330, 332, 342, 362, 363, 364, 365, 366, 367, 373], "1e": [3, 5, 14, 137, 260, 269, 270, 272, 300, 330, 332, 342, 362, 363, 364, 365, 366, 367, 370, 373, 375, 376, 377, 378, 379], "weight": [3, 85, 86, 87, 112, 113, 246, 256, 284, 288, 299, 329, 331, 359, 363, 366, 368, 370, 374, 387, 389], "squar": [3, 4, 113, 135, 201, 216, 237, 246, 256, 300, 339, 341, 362, 363, 365, 366, 367, 387, 390], "loss": [3, 5, 237, 256, 361, 386, 387, 389], "loss_fn": [3, 5, 361, 386, 387], "w": [3, 86, 97, 184, 185, 237, 259, 260, 262, 264, 265, 273, 275, 374, 387], "mean": [3, 4, 5, 113, 190, 191, 237, 256, 260, 269, 282, 300, 318, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 386, 387, 390], "grad_fn": [3, 386, 387], "randomli": [3, 4, 263, 264, 265], "Then": [3, 7], "repeatedli": 3, "_": [2, 3, 4, 256, 375, 376, 377, 378, 379, 383, 386, 389, 393], "verifi": [3, 7], "close": [3, 6, 7, 14, 137], "error_norm": 3, "5f": 3, "someth": [3, 4, 388], "00005": 3, "00364": 3, "complet": [3, 4, 7, 169, 295, 296, 387, 393], "logist": [3, 209, 322, 323, 349], "github": [3, 5, 7, 386], "repo": [3, 5, 7, 386], "enabl": [2, 4, 7, 83, 103, 374], "larg": [4, 256, 297, 337, 386, 389], "ish": 4, "transform": [4, 6, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 244, 256, 260, 269, 272, 273, 281, 282, 294, 299, 303, 388], "compromis": 4, "eas": 4, "llama": 4, "famili": 4, "less": [4, 25, 145, 182, 303, 341], "200": [4, 377], "line": [4, 389, 390], "python": [2, 4, 46, 64, 73, 107, 245, 246, 247, 359, 369, 370, 372, 385, 387, 390], "neural": [4, 6, 266, 313, 314, 343, 356, 359, 373], "network": [4, 6, 260, 264, 266, 313, 314, 356, 359, 373], "concis": 4, "architectur": [4, 7, 256, 296, 393], "notabl": [4, 6], "rope": [4, 256], "posit": [4, 25, 99, 114, 128, 132, 141, 174, 182, 190, 237, 246, 256, 261, 262, 297, 303, 307, 332, 342], "cach": [4, 164, 165, 168, 386], "concaten": 4, "llamaattent": 4, "self": [4, 5, 8, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 65, 67, 68, 69, 70, 71, 72, 73, 74, 75, 248, 256, 343, 359], "dim": [4, 114, 115, 266, 269, 270, 272, 297, 300, 303, 307, 310], "num_head": [4, 297, 310], "super": [4, 5, 256, 359], "tradit": [4, 114, 264, 265, 303], "query_proj": 4, "bia": [4, 97, 112, 184, 185, 246, 256, 261, 262, 268, 271, 272, 273, 282, 284, 294, 297, 299, 301, 365, 366, 367, 370, 387], "key_proj": 4, "value_proj": 4, "out_proj": [4, 359], "__call__": [4, 5, 256, 359], "queri": [4, 115, 297], "mask": [4, 115, 291, 297, 388], "extract": [4, 41, 98, 99, 256, 281, 359], "l": [4, 5, 256, 258, 260, 261, 268, 271, 274, 301, 341], "reshap": [4, 146, 311, 388], "combin": 4, "key_cach": 4, "value_cach": 4, "sqrt": [4, 105, 115, 260, 269, 270, 272, 273, 300, 307, 313, 314, 315, 316, 362, 364, 365, 366, 373, 386], "score": [4, 115, 338], "softmax": [4, 115, 256, 328, 331], "values_hat": 4, "rm": [4, 7, 113, 363], "swiglu": 4, "rmsnorm": [4, 256], "llamaencoderlay": 4, "mlp_dim": [4, 310], "norm1": 4, "norm2": 4, "linear1": 4, "linear2": 4, "linear3": 4, "sigmoid": [4, 256, 306, 322, 323, 327, 349], "instanc": [4, 35, 184, 247, 256, 270, 277, 278, 279, 282, 284, 285, 286, 291, 294, 295, 296, 305, 359, 390], "embed": [4, 256, 303, 307, 330], "emb": [4, 266, 307], "token": [4, 266], "num_lay": [4, 5, 361], "vocab_s": 4, "norm": [4, 113, 269, 342, 367, 368], "multiheadattent": [4, 256], "create_additive_causal_mask": 4, "list": [4, 9, 13, 15, 27, 67, 73, 77, 78, 79, 80, 83, 84, 87, 107, 117, 118, 120, 121, 123, 124, 126, 127, 131, 132, 143, 146, 158, 160, 162, 163, 172, 178, 181, 183, 186, 187, 188, 190, 191, 192, 195, 196, 203, 213, 215, 219, 220, 224, 230, 231, 233, 237, 238, 239, 242, 245, 247, 256, 282, 284, 285, 286, 287, 292, 294, 295, 296, 359, 365, 366, 367, 368, 377, 385, 386, 387, 389], "still": [4, 7, 146, 386, 389], "consid": [4, 14, 76, 137, 245, 246, 269, 385], "train": [4, 5, 256, 260, 263, 264, 265, 280, 282, 294, 313, 314], "ignor": [4, 35, 82, 83, 107, 363], "whatsoev": 4, "rest": [4, 114, 246, 303], "subsect": 4, "prompt": 4, "autoregress": 4, "yield": [4, 5, 383], "temp": 4, "causal": 4, "append": [4, 159, 386, 389], "store": 4, "per": [4, 5, 97, 184, 185, 260, 269, 270, 272, 300, 381, 386, 389], "care": [4, 389], "last": [4, 26, 73, 112, 113, 118, 121, 123, 124, 126, 127, 128, 136, 147, 159, 187, 214, 230, 261, 262, 264, 265, 269, 311, 390], "logit": [4, 187, 329, 331, 386], "next": [1, 4, 5, 168], "categor": 4, "lazili": [4, 256], "noth": [4, 256, 389], "yet": [4, 146, 256, 359, 370, 387, 388, 389, 391], "forc": [4, 5, 256, 391], "choos": [4, 114, 303], "pars": 4, "feed": 4, "loop": [4, 5, 386, 387, 389], "unsqueez": 4, "sequenc": [4, 13, 15, 30, 31, 52, 53, 54, 55, 59, 67, 70, 71, 75, 80, 87, 109, 117, 118, 120, 121, 123, 124, 126, 127, 131, 158, 160, 162, 172, 178, 183, 186, 187, 188, 190, 191, 192, 195, 196, 199, 213, 215, 218, 220, 224, 230, 231, 233, 238, 242, 260, 261, 268, 271, 301, 310, 383, 393], "length": [4, 218, 260, 261, 268, 271, 301, 377], "len": [4, 118, 121, 124, 127, 377], "overwrit": 4, "discard": [4, 245], "old": 4, "moment": [4, 87, 363, 365, 366, 367], "anymor": 4, "everyth": 4, "small": [4, 110, 112, 113, 260, 269, 272, 300, 332, 337, 342, 386, 393], "12": [4, 377], "8192": 4, "1024": 4, "actual": [4, 16, 284, 359, 389], "materi": [4, 6], "could": [4, 256], "20_000": 4, "machin": [4, 6, 7, 373], "8gb": 4, "ram": 4, "32": [4, 5, 184, 185, 250, 259, 275, 300, 386], "44": 4, "doubl": 4, "bracket": 4, "becaus": [4, 164, 256, 389], "batch": [4, 159, 190, 260, 261, 262, 264, 265, 268, 271, 297, 301, 311, 389], "zip": [4, 5], "haven": 4, "anyth": [4, 237, 389], "result": [4, 16, 35, 73, 83, 97, 112, 113, 136, 146, 149, 159, 180, 185, 190, 198, 200, 219, 230, 231, 241, 246, 307, 386, 387, 390], "similar": [4, 142, 246, 295, 296, 297, 330, 390, 392], "runtim": [4, 386], "section": [4, 7, 215, 342, 386, 387], "access": [4, 46, 256, 359, 370, 389, 393], "origin": [4, 99, 260, 290, 313, 314, 315, 316, 362, 363, 364, 365, 367, 368, 390], "sentencepiec": 4, "pytorch": [4, 6, 269, 387], "compat": [4, 187, 190, 392], "npz": [4, 149, 205, 206, 284, 288, 392], "file": [4, 7, 149, 202, 203, 204, 205, 206, 284, 288, 387, 392], "directli": [1, 4], "argpars": 4, "itertool": [4, 246], "starmap": [4, 246], "np": [4, 5, 390, 391], "torch": [4, 390], "map_torch_to_mlx": 4, "tok_embed": 4, "elif": 4, "replac": [4, 295, 296, 310, 341], "attention_norm": 4, "ffn_norm": 4, "wq": 4, "wk": 4, "wv": 4, "wo": 4, "w1": 4, "w2": 4, "w3": 4, "ffn": 4, "separ": [4, 61, 74, 269, 338], "submodul": [4, 5, 256, 278, 282, 283, 294, 296], "feed_forward": 4, "parser": 4, "argumentpars": 4, "add_argu": 4, "torch_weight": 4, "output_fil": 4, "parse_arg": 4, "state": [4, 5, 256, 268, 271, 301, 361, 370, 383, 386], "savez": [4, 288, 392], "k": [4, 41, 98, 111, 115, 232, 234, 235, 236, 258, 273, 274, 282], "v": [4, 88, 115, 256, 282, 390], "left": [4, 114, 146, 184, 258, 259, 267, 274, 275, 303, 311, 322, 323, 332, 334, 342], "disk": 4, "text": [4, 258, 259, 268, 271, 274, 275, 276, 301, 309, 313, 314, 315, 316, 325, 332, 333, 334, 337, 338, 341, 343, 344, 347, 348, 352, 353, 363, 368], "format": [4, 149, 202, 203, 204, 205, 206, 390], "dictionari": [4, 83, 149, 203, 204, 245, 256, 281, 290, 295, 296, 371, 385, 392], "represent": [4, 184, 245, 247], "tree_unflatten": 4, "helper": [4, 386], "weight_fil": 4, "incur": 4, "sever": [4, 85, 86, 87, 205, 206, 386, 392], "futur": [4, 299, 388, 389], "pth": 4, "current": [4, 6, 7, 85, 86, 87, 165, 184, 256, 363, 389], "around": 4, "m1": [4, 386, 387, 393], "ultra": 4, "7b": 4, "me": 4, "ishmael": 4, "year": 4, "ago": 4, "never": [4, 389], "long": 4, "info": [4, 7], "247": 4, "press": [4, 146], "enter": 4, "littl": 4, "monei": 4, "my": [4, 7], "purs": 4, "greater": [4, 25, 110, 134, 182, 309, 353], "consequ": 4, "walk": 4, "down": 4, "gower": 4, "street": 4, "afternoon": 4, "heavi": 4, "rain": 4, "saw": [4, 387], "off": [4, 7, 389], "man": 4, "rag": 4, "who": 4, "sat": 4, "upon": [4, 246], "hi": [4, 271], "bundl": 4, "hard": 4, "wet": 4, "he": [4, 315, 316], "were": [4, 393], "cry": 4, "watch": [4, 386], "him": 4, "observ": 4, "numer": [4, 112, 113, 146, 154, 158, 213, 260, 269, 270, 272, 300, 330, 332, 342, 362, 363, 364, 365, 366, 367, 373, 386, 389], "crowd": 4, "wa": [4, 170, 389], "hurri": 4, "437": 4, "330": 4, "second": [4, 99, 155, 157, 159, 225, 237, 259, 275, 330, 338, 363, 365, 366, 367, 387, 393], "spent": 4, "amount": [4, 166, 258, 274], "39": 4, "By": [4, 289, 387, 390], "bigger": [4, 363], "remain": [4, 237, 263, 264, 265], "almost": 4, "nobodi": 4, "took": 4, "least": [4, 77, 78, 79, 82, 147, 184], "notic": [4, 387, 392], "distanc": [4, 342], "had": 4, "doubt": 4, "minut": 4, "straight": 4, "slowli": 4, "rais": [4, 146, 169, 215, 284], "ey": 4, "speak": [4, 146], "resum": 4, "postur": 4, "stood": 4, "feel": 4, "pain": 4, "heart": 4, "smile": 4, "face": 4, "am": 4, "someon": 4, "three": [4, 79, 311], "quarter": 4, "hour": 4, "made": 4, "immedi": [4, 277], "repli": 4, "again": [4, 7, 256, 386], "hand": [4, 387, 389], "did": 4, "accustom": 4, "thu": [4, 256], "question": [4, 389], "reason": [4, 388], "tell": [4, 386, 390], "understand": [4, 313, 314], "579": 4, "690": 4, "num": [4, 148, 194], "500": [4, 393], "628": 4, "went": 4, "nervou": 4, "trembl": 4, "told": 4, "And": [4, 311], "perhap": [1, 4], "surpris": 4, "matter": [4, 256], "shall": 4, "anyhow": 4, "friend": 4, "ye": 4, "slight": [4, 389], "kind": 4, "longer": [4, 88, 387], "soon": 4, "unless": [4, 14, 137, 146, 359], "unlik": [4, 14, 137, 264, 265, 290], "strang": 4, "amus": 4, "That": 4, "secret": 4, "disappoint": 4, "mine": 4, "cannot": [4, 82, 388, 390], "happi": 4, "ask": 4, "shop": 4, "bui": 4, "food": 4, "633": 4, "21": [4, 379], "475": 4, "su": 4, "j": [4, 7, 146, 264, 364, 365, 367], "lu": 4, "pan": 4, "murtadha": 4, "wen": 4, "liu": 4, "2021": 4, "roform": [4, 303], "enhanc": [4, 303, 389], "rotari": [4, 114, 303], "arxiv": [4, 269, 270, 272, 276, 300, 323, 343, 362, 368], "preprint": [4, 362, 368], "2104": 4, "09864": 4, "zhang": 4, "sennrich": 4, "2019": [4, 366], "root": [4, 113, 201, 216, 300], "advanc": [4, 386], "system": [4, 7, 164, 165], "shazeer": 4, "2020": 4, "glu": [4, 256], "variant": [4, 341, 367], "2002": 4, "05202": 4, "classifi": 5, "mnist": 5, "As": [5, 35, 226, 256, 386], "mlp": [5, 256, 310, 361], "inherit": [5, 385], "standard": [5, 46, 73, 159, 188, 191, 220, 310, 313, 315, 318, 391], "idiom": [5, 386], "input_dim": [5, 256, 273, 299], "hidden_dim": [5, 359, 361], "output_dim": [5, 256, 273, 299], "layer_s": 5, "idim": 5, "odim": 5, "maximum": [5, 23, 35, 82, 91, 166, 169, 256, 302, 307, 322, 323, 326, 345, 359, 389], "cross": [5, 87, 329, 331], "entropi": [5, 329, 331], "sub": [5, 99, 194], "commonli": [5, 295, 356, 386], "cross_entropi": [5, 256], "accuraci": 5, "valid": [5, 88, 128, 240, 245, 282, 294, 385], "eval_fn": 5, "argmax": 5, "loader": 5, "num_class": [5, 361], "batch_siz": [5, 361], "num_epoch": [5, 361], "learning_r": [5, 361, 362, 363, 364, 365, 366, 367, 368, 370, 373, 374, 375, 376, 377, 378, 379, 386], "train_imag": [5, 361], "train_label": [5, 361], "test_imag": 5, "test_label": 5, "shuffl": 5, "minibatch": 5, "batch_iter": [5, 361], "perm": 5, "permut": 5, "id": [5, 7], "put": [5, 386], "trainabl": [5, 244, 256, 359], "loss_and_grad_fn": [5, 361, 386, 387], "value_and_grad": [5, 256, 295, 359, 361, 372, 386, 387, 390, 391], "epoch": 5, "test": [5, 7], "confus": 5, "decent": 5, "95": 5, "brought": 6, "research": 6, "except": [6, 111, 122, 123, 125, 126, 127, 269, 284, 388, 390], "featur": [6, 85, 86, 87, 114, 260, 268, 269, 270, 271, 272, 273, 299, 300, 301, 303, 310, 311, 386, 389], "differ": [6, 142, 223, 341, 387], "lazi": [6, 359, 391], "multi": [6, 115, 261, 262, 388, 390], "cpu": [6, 147, 386, 393], "inspir": 6, "jax": [6, 383], "arrayfir": 6, "unifi": 6, "live": [6, 393], "guid": [1, 6], "convers": 6, "regress": [6, 337], "layer": [6, 112, 256, 258, 259, 264, 265, 268, 269, 271, 272, 273, 274, 275, 291, 296, 299, 301, 305, 310, 355, 359], "perceptron": 6, "llm": 6, "infer": [6, 131, 149], "fft": 6, "algebra": 6, "tree": [6, 83, 107, 132, 237, 240, 245, 246, 247, 369, 370, 372, 381, 387], "debugg": 6, "pypi": 7, "meet": 7, "seri": 7, "chip": 7, "nativ": 7, "maco": 7, "13": 7, "recommend": [7, 169, 368], "14": 7, "sonoma": 7, "conda": 7, "forg": 7, "distribut": [7, 186, 187, 188, 190, 191, 195, 196, 273, 313, 314, 315, 316, 318, 319, 332, 335, 340, 342, 356], "probabl": [7, 192, 263, 264, 265, 299, 329, 331, 335, 393], "platform": 7, "processor": 7, "arm": 7, "i386": 7, "switch": 7, "17": 7, "clang": 7, "24": 7, "xcode": 7, "15": [7, 146, 386], "sdk": 7, "environ": [7, 100, 103], "via": [7, 369, 372, 389, 390], "rosetta": 7, "unam": 7, "p": [7, 186, 256, 263, 264, 265, 342, 365, 367], "clone": 7, "git": 7, "com": 7, "ml": 7, "explor": 7, "nanobind": [1, 7, 310], "http": [7, 269, 270, 272, 276, 300, 323, 343], "wjakob": 7, "env": 7, "cmake_build_parallel_level": 7, "edit": [7, 296], "unittest": 7, "discov": 7, "stub": 7, "dev": [1, 7], "generate_stub": 7, "either": [7, 12, 61, 73, 74, 82, 101, 102, 104, 130, 133, 134, 144, 145, 146, 154, 159, 161, 173, 175, 223, 237, 259, 275, 305, 311, 315, 316], "libmlx": 7, "preprocessor": 7, "metal_path": 7, "mlx_build_test": 7, "mlx_build_exampl": 7, "mlx_build_benchmark": 7, "mlx_build_python_bind": 7, "multipl": [7, 112, 113, 159, 175, 184, 185, 297, 307, 376, 377, 379, 386, 389, 392], "wish": 7, "variabl": [7, 83, 100, 103, 132, 143, 237, 239, 240], "export": 7, "developer_dir": 7, "app": 7, "content": [7, 281, 386], "xcrun": 7, "macosx": 7, "show": [7, 250, 386], "unabl": 7, "tool": 7, "sudo": 7, "ouptut": 7, "finder": 7, "iterm": 7, "termin": 7, "click": 7, "uncheck": 7, "window": [7, 258, 259, 274, 275], "restart": 7, "grep": 7, "cmake_host_system_processor": 7, "arm64": 7, "x86_64": 7, "wipe": 7, "cahc": 7, "rf": 7, "devicetyp": 8, "attribut": [8, 9, 27, 248, 290, 359, 381], "kwarg": [9, 10, 205, 206, 394], "categori": [10, 250], "bool_": [10, 250], "integ": [10, 130, 142, 146, 181, 184, 185, 186, 192, 215, 230, 240, 250, 266, 289, 377, 388], "unsignedinteg": 10, "uint8": [10, 250], "uint16": [10, 250], "uint32": [10, 23, 24, 25, 26, 187, 250], "uint64": [10, 250], "signedinteg": [10, 142], "int8": [10, 250], "int32": [10, 16, 35, 128, 142, 146, 192, 250, 311, 388, 391], "int64": [10, 250], "inexact": [10, 142], "complexflo": 10, "complex128": 10, "issubdtyp": [10, 250], "absolut": [11, 14, 137, 322, 323, 341], "semant": [12, 80, 101, 102, 104, 133, 134, 144, 145, 154, 159, 161, 173, 175, 223, 393], "keepdim": [13, 15, 23, 24, 30, 31, 32, 33, 52, 53, 54, 55, 59, 71, 75, 146, 158, 160, 162, 172, 183, 213, 220, 224, 238], "reduct": [13, 15, 158, 160, 172, 183, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342], "reduc": [13, 15, 23, 24, 158, 160, 162, 172, 183, 220, 224, 238, 260, 310, 337], "unspecifi": [13, 15, 16, 23, 24, 25, 26, 84, 91, 92, 93, 94, 131, 158, 160, 162, 172, 178, 182, 183, 198, 213, 214, 220, 224, 226, 232, 238, 242, 394], "entir": [13, 15, 23, 24, 158, 160, 162, 172, 183, 220, 224, 238, 264, 265], "singleton": [13, 15, 23, 24, 158, 159, 160, 162, 172, 183, 220, 224, 238], "rtol": [14, 137], "05": [14, 137, 260, 269, 270, 272, 300], "atol": [14, 137], "08": [14, 137, 330, 364, 365, 366, 367, 373], "equal_nan": [14, 76, 137], "approxim": [14, 267, 321, 322, 323], "comparison": [14, 104, 133, 134, 144, 145], "infinit": [14, 137], "equal": [14, 25, 76, 111, 134, 137, 145, 182, 192, 215, 270, 273], "sign": [14, 137, 250, 368], "nan": [14, 76, 137, 139], "ab": [14, 137, 146, 237, 269, 270, 272, 276, 300, 323, 343, 386], "array_equ": [14, 137], "rel": [14, 137, 363, 386], "toler": [14, 137], "boolean": [14, 76, 137, 138, 139, 140, 141, 155, 156, 157, 250, 293, 388], "interv": [16, 148, 192, 196], "increment": 16, "otherwis": [16, 87, 169, 245, 246, 282, 284, 294, 309, 310, 311, 329, 334, 341, 352, 353, 389, 390], "convent": [16, 88, 311, 366], "lead": [16, 386], "fraction": 16, "integr": [16, 226, 389], "invers": [17, 18, 19, 20, 21, 22, 106, 119, 120, 121, 122, 123, 124], "cosin": [17, 18, 89, 90, 330, 375, 377, 387], "hyperbol": [18, 20, 22, 90, 212, 229, 354], "sine": [19, 20, 211, 212, 387], "minimum": [24, 35, 82, 92, 307, 330, 375], "kth": [25, 182], "partit": 25, "order": [25, 87, 146, 182, 184, 232, 256, 269, 295, 305, 370, 386, 387], "undefin": [25, 182, 190, 388], "sort": [25, 26, 182, 232], "flatten": [25, 26, 91, 92, 93, 94, 146, 180, 182, 198, 214, 226, 227, 232, 245], "dimension": [27, 112, 113, 116, 117, 118, 119, 120, 121, 125, 126, 127, 258, 259, 260, 261, 262, 266, 273, 274, 275, 299, 307, 388, 390], "val": [27, 131], "tupl": [27, 61, 64, 74, 84, 86, 87, 102, 107, 109, 143, 146, 147, 181, 184, 199, 218, 237, 239, 245, 246, 247, 258, 259, 262, 274, 275, 284, 286, 305, 311, 363, 365, 366, 367, 368, 385, 387], "ndarrai": [27, 388, 389, 391], "properti": [28, 35, 43, 47, 57, 58, 64, 66, 290, 293, 371, 387], "argument": [28, 61, 74, 83, 107, 132, 237, 246, 256, 311, 383, 387, 392, 393, 394], "union": [29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 65, 67, 68, 69, 70, 71, 72, 74, 75, 77, 78, 79, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 140, 141, 194, 195, 222], "appli": [35, 114, 115, 246, 256, 258, 259, 260, 261, 262, 264, 265, 267, 269, 270, 272, 273, 274, 275, 276, 278, 291, 298, 299, 300, 301, 302, 304, 306, 308, 309, 311, 320, 321, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 356, 369, 372, 378, 381, 386], "regular": [35, 264, 343, 366, 386, 388], "idx": [35, 388], "correctli": 35, "syntax": [35, 388], "subtract": 35, "inclus": [37, 38, 39, 40, 91, 92, 93, 94, 128], "diagon": [41, 98, 111, 234, 235, 236], "axis1": [42, 72, 99, 225], "axis2": [42, 72, 99, 225], "start_axi": [45, 128], "end_axi": [45, 128], "datatyp": 47, "byte": [47, 57, 164, 165, 166, 168, 169, 250], "decim": [62, 200], "indices_or_sect": [67, 215], "nest": [73, 83, 256, 359, 385, 387], "ddof": [75, 220, 238], "ari": [77, 78, 79], "a_min": 82, "a_max": 82, "edg": [82, 181, 311, 386], "At": 82, "anoth": [82, 142, 159, 223, 241, 250, 256, 277, 386, 387, 388, 393], "fun": [83, 132, 143, 237, 239, 240, 386, 388, 389, 393], "callabl": [83, 132, 143, 237, 239, 240, 244, 245, 246, 277, 278, 281, 289, 301, 305, 310, 312, 313, 314, 315, 316, 317, 318, 319, 362, 363, 364, 365, 366, 367, 368, 373, 374, 375, 376, 377, 378, 379], "shapeless": 83, "dict": [83, 107, 149, 203, 204, 205, 287, 292, 295, 296, 359, 369, 370, 372, 385, 387, 392], "arbitrarili": [83, 256, 385, 387, 391], "leaf": [83, 245, 246, 281], "node": [83, 107, 240], "recompil": [83, 386], "chang": [83, 208, 295, 299, 311, 334, 341, 386, 390], "Not": [83, 386], "attempt": 83, "pad": [85, 86, 87, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 258, 259, 261, 262, 274, 275], "dilat": [85, 86, 87, 261, 262], "group": [85, 86, 87, 97, 115, 184, 185, 269, 299], "1d": [85, 87, 88, 203, 227], "convolut": [85, 86, 87, 88, 261, 262, 264, 265], "channel": [85, 86, 87, 260, 261, 262, 264, 265], "c_in": [85, 86, 87], "c_out": [85, 86, 87], "convolv": [85, 86, 87], "2d": [86, 87, 99, 184, 260, 264], "spatial": [86, 87, 258, 269, 274, 311], "symmetr": 86, "kernel_dil": 87, "input_dil": 87, "flip": [87, 88], "correl": [87, 264], "discret": [88, 116, 117, 118, 119, 120, 121, 125, 126, 127, 266], "swap": [88, 169, 225, 296, 299], "conv": 88, "filter": [88, 261, 262, 277, 281], "signal": [88, 311], "cumul": [91, 92, 93, 94], "th": [91, 92, 93, 94, 98, 111, 377], "bias": [97, 184, 185, 268, 271, 282, 294, 297], "group_siz": [97, 184, 185, 299], "64": [97, 184, 185, 250, 299], "configur": 97, "formal": [97, 184], "notat": [97, 245, 286], "quantiz": [97, 149, 185, 299], "w_i": [97, 184], "hat": [97, 184], "occupi": [97, 184, 185], "subarrai": [99, 215], "remov": [99, 159, 187, 218, 331], "insert": [99, 109, 393], "neg": [99, 128, 140, 274, 275, 297, 332, 340, 342, 388], "taken": [99, 226], "global": [100, 103, 193, 383, 386], "disabl": [100, 168, 386], "mlx_disable_compil": [100, 103, 386], "divis": [101, 130, 184], "quotient": [101, 102, 130], "remaind": 102, "fuction": 102, "faster": [1, 102, 321, 386, 387], "mathrm": [105, 209, 270], "frac": [105, 184, 209, 258, 259, 260, 263, 264, 265, 269, 270, 272, 273, 274, 275, 300, 313, 314, 315, 316, 330, 332, 334, 337, 348, 350, 362, 364, 365, 366, 367, 373], "pi": [105, 307, 387], "int_0": 105, "dt": 105, "erf": [106, 386], "exponenti": [108, 110, 304, 320, 347, 376], "ident": [111, 221, 256, 291], "zero": [111, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 163, 234, 235, 236, 243, 256, 258, 259, 263, 264, 265, 284, 312, 313, 314, 315, 316, 317, 318, 319, 356, 363, 388], "whose": [111, 244], "translat": [112, 272], "stabil": [112, 113, 260, 269, 270, 272, 300, 330, 332, 362, 363, 364, 365, 366, 367, 373], "traditino": 114, "rotat": [114, 303], "larger": [114, 303, 368], "unchang": [114, 221, 303], "consecut": [114, 184, 303], "angular": [114, 303], "frequenc": [114, 303, 307], "q": [115, 147], "head": [115, 297, 310], "attent": [115, 282, 297, 307, 310], "regardless": 115, "pre": 115, "tile": 115, "typic": [115, 266, 361, 386, 389], "One": [116, 119, 125, 201, 386, 387], "fourier": [116, 117, 118, 119, 120, 121, 125, 126, 127], "truncat": [116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 195], "dft": [116, 117, 118, 119, 120, 121, 125, 126, 127], "rfft": 122, "real": [122, 123, 124, 125, 126, 127], "rfft2": 123, "rfftn": 124, "silent": [125, 126, 127], "outsid": 128, "clamp": 128, "floor": 130, "argnam": [132, 237], "neither": [132, 237], "keyword": [132, 205, 206, 237, 246, 256, 383, 392, 394], "strict": [133, 144, 282, 284, 294], "ordinari": 136, "inifn": 138, "infin": [138, 140, 141, 274, 275, 367], "dtypecategori": [142, 250], "subtyp": [142, 250], "subdtyp": 142, "float64": 142, "too": [142, 386, 389], "ord": 146, "tabl": [146, 250, 266], "frobeniu": 146, "matric": [146, 147], "strictli": 146, "mathemat": 146, "variou": 146, "purpos": 146, "calcul": [146, 332, 338, 363], "fro": 146, "inf": [146, 297], "largest": [146, 232], "sing": 146, "smallest": 146, "singular": 146, "nuclear": 146, "_f": 146, "sum_": [146, 258, 259, 337], "a_": 146, "valueerror": [146, 284, 387], "refer": [146, 270, 276, 290, 313, 314, 315, 316, 323, 343, 388], "golub": 146, "van": 146, "loan": 146, "baltimor": 146, "md": 146, "john": 146, "hopkin": 146, "univers": 146, "1985": 146, "pg": 146, "la": 146, "9": [146, 331, 362, 365, 366, 367, 368, 370, 376, 379, 390], "74597": 146, "84804": 146, "41421": 146, "23607": [146, 147], "74166": 146, "24264": 146, "11": 146, "225": 146, "894427": 147, "447214": 147, "57771": 147, "50": 148, "evenli": 148, "return_metadata": 149, "binari": [149, 202, 203, 204, 205, 206, 309, 329, 353, 386], "npy": [149, 202, 392], "safetensor": [149, 204, 284, 288, 389, 392], "gguf": [149, 203, 392], "matadata": 149, "unsupport": 149, "tensor": [149, 230, 258, 259, 274, 275, 342, 390], "natur": [150, 152, 389], "logarithm": [150, 151, 152, 153], "log": [152, 154, 158, 327, 328, 332, 335, 337, 340, 351], "plu": 152, "exp": [110, 154, 158, 188, 213, 320, 335, 347, 348, 351, 386, 393], "stabl": [154, 158, 213, 337], "prepend": [2, 159], "report": [164, 169], "peak": 166, "begin": [166, 184, 259, 268, 271, 275, 309, 334, 341, 347, 352, 353], "program": 166, "free": 168, "reclaim": 168, "set_memory_limit": 168, "previou": [168, 169], "relax": 169, "task": [169, 337], "exceed": 169, "negat": 176, "beforehand": 180, "pad_with": 181, "constant_valu": 181, "pad_width": 181, "before_1": 181, "after_1": 181, "before_2": 181, "after_2": 181, "before_n": 181, "after_n": 181, "before_i": 181, "after_i": 181, "extend": [1, 181], "side": [181, 258, 259, 274, 275, 386], "smaller": [182, 368, 386], "everi": [184, 246, 379, 387], "particular": [184, 269], "w_1": 184, "w_g": 184, "align": [184, 259, 268, 271, 275], "max_i": 184, "min_i": 184, "textrm": [184, 267, 321, 324], "round": 184, "pack": [184, 185], "unsign": [184, 185, 250], "lower": [184, 192, 195, 196, 234, 319], "upper": [184, 192, 195, 196, 319], "1st": 184, "signific": 184, "2nd": 184, "dequant": 184, "w_q": 184, "whether": [170, 185, 268, 271, 281, 297, 301, 329, 332, 338], "prng": [186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 383], "num_sampl": 187, "unnorm": [187, 329, 331], "draw": 187, "cdf": [188, 267, 321], "accord": [188, 241, 297, 313, 314, 315, 316], "seed": 189, "loc": 191, "deviat": [191, 220, 313, 315, 318], "low": [192, 196, 319, 356], "high": [192, 196, 256, 266, 319, 356], "bound": [192, 195, 196, 267, 319, 386, 388, 393], "roadcast": 192, "domain": 195, "uniformli": 196, "repetit": 198, "preserv": [199, 387], "reciproc": 201, "arr": [202, 388], "obj": 203, "uncompress": 205, "my_path": 205, "tree_flatten": [205, 246, 247, 256], "transformerencod": 205, "128": [205, 256], "flat_param": 205, "compress": 206, "possibl": [215, 266, 386, 388, 393], "being": [221, 256], "prevent": [221, 342, 390], "flow": [221, 389], "streamcontext": 222, "context": 222, "manag": [222, 383, 393], "prior": [226, 227], "exclud": 227, "dot": [230, 245, 286, 297], "rep": 231, "repeat": 231, "necessarili": 232, "elsewher": [234, 388], "col": 234, "triangl": 234, "mse": 237, "param": [237, 256, 356, 387], "lvalu": 237, "dlvalu": 237, "dparam": 237, "lasso": 237, "l1": [237, 334, 336, 337, 341], "varianc": [220, 238, 260, 269, 332], "divisor": [220, 238], "cotang": [1, 239], "in_ax": [240, 387], "out_ax": [240, 387], "prefix": [240, 245], "fn": [244, 246, 391], "wrt": 244, "is_leaf": [245, 246], "arbitrari": [245, 359], "depth": [245, 265, 387], "hello": [245, 247], "charact": 245, "flat": [245, 247], "superset": [246, 369], "extra": 246, "closer": 246, "constitut": 246, "dict_kei": [246, 370], "lambda": [246, 256, 277, 282, 289, 308, 347, 352, 362, 363, 364, 365, 366, 367, 368, 373, 374, 386, 387], "recreat": 247, "world": 247, "42": 247, "16": [250, 258, 270, 274, 277, 359], "int16": 250, "brain": 250, "e8": 250, "m7": 250, "ieee": 250, "e5": 250, "m10": 250, "hierarchi": 250, "done": [256, 263, 300, 386, 389, 390], "manual": 256, "explicitli": [256, 383], "solv": 256, "intuit": 256, "freez": [256, 294, 359], "finetun": 256, "in_dim": [256, 359], "out_dim": [256, 359], "enumer": 256, "caus": [256, 386, 389], "local": [256, 264], "scope": 256, "l2_loss": 256, "y_hat": 256, "trainable_paramet": [256, 281, 370], "loss_and_grad": 256, "workhors": 256, "Its": 256, "recurs": [256, 281, 282, 287, 292, 294, 359], "frozen": [256, 282, 292, 294, 299, 359], "individu": [256, 264, 265], "subset": [256, 281], "action": 256, "displai": 256, "tree_map": 256, "count": [256, 377], "num_param": 256, "preclud": 256, "pure": [256, 361], "pattern": [256, 389], "achiev": 256, "other_input": 256, "necessari": 256, "wrap": 256, "apply_to_modul": [256, 282], "children": 256, "filter_and_map": 256, "leaf_modul": 256, "load_weight": [256, 389], "named_modul": 256, "save_weight": 256, "set_dtyp": 256, "unfreez": [256, 282], "update_modul": 256, "alibi": 256, "avgpool1d": 256, "avgpool2d": 256, "batchnorm": 256, "conv1d": 256, "conv2d": 256, "dropout": [256, 264, 265, 291, 310, 386], "dropout2d": 256, "dropout3d": 256, "gelu": [256, 322, 323, 386], "groupnorm": 256, "gru": 256, "instancenorm": 256, "layernorm": 256, "lstm": 256, "maxpool1d": 256, "maxpool2d": [256, 259], "mish": 256, "prelu": 256, "quantizedlinear": 256, "relu": [256, 298, 310, 344, 356], "rnn": [256, 268], "selu": 256, "sequenti": [256, 356], "silu": 256, "sinusoidalpositionalencod": 256, "softshrink": 256, "upsampl": 256, "elu": [256, 347], "gelu_approx": [256, 267, 321], "gelu_fast_approx": [256, 267, 321], "hardswish": 256, "leaky_relu": 256, "log_sigmoid": 256, "log_softmax": 256, "relu6": 256, "softplu": [256, 276, 343], "tanh": [256, 268, 271, 276, 301, 343], "binary_cross_entropi": [256, 386], "cosine_similarity_loss": 256, "gaussian_nll_loss": 256, "hinge_loss": 256, "huber_loss": 256, "kl_div_loss": 256, "l1_loss": 256, "log_cosh_loss": 256, "margin_ranking_loss": 256, "mse_loss": 256, "nll_loss": 256, "smooth_l1_loss": 256, "triplet_loss": 256, "init": [256, 298, 356, 361, 375, 376, 378, 379], "uniform": [2, 256, 273, 284, 314, 316, 356, 383, 386, 387, 393], "glorot_norm": 256, "glorot_uniform": 256, "he_norm": 256, "he_uniform": 256, "kernel_s": [258, 259, 261, 262, 274, 275], "averag": [258, 259, 362, 363, 365, 366, 367], "pool": [258, 259, 274, 275, 393], "l_": [258, 274, 334], "n_i": [258, 259, 274, 275], "c_j": [258, 259, 274, 275], "ldot": [258, 259, 274, 275], "lfloor": [258, 259, 274, 275], "_size": [258, 259, 274, 275], "rfloor": [258, 259, 274, 275], "k_h": [259, 275], "k_w": [259, 275], "h_": [259, 268, 271, 275, 301], "w_": [259, 268, 271, 275, 301, 362, 363, 364, 365, 366, 367, 368, 373, 374], "height": [259, 260, 262, 264, 265, 275], "width": [259, 260, 262, 264, 265, 275, 299], "momentum": [260, 368, 370, 374, 386], "affin": [260, 269, 270, 272, 273, 299], "track_running_stat": 260, "var": [260, 269, 270, 272, 332], "epsilon": [260, 269, 270, 272, 300, 330, 332, 362, 364, 365, 366, 367, 373], "gamma": [260, 269, 270, 272, 300, 313, 314, 315, 316], "nc": 260, "nlc": [260, 261], "four": 260, "nhwc": [260, 262], "paper": [260, 307, 362, 363, 364, 365, 367, 368], "deep": [260, 313, 314, 315, 316], "intern": 260, "covari": [190, 260], "shift": 260, "bn": 260, "in_channel": [261, 262], "out_channel": [261, 262], "learnabl": [261, 262, 305], "portion": 263, "independ": [264, 265], "nwhc": 264, "whc": 264, "maintain": [264, 265, 368], "entri": [264, 265], "benefici": [264, 265, 389], "earli": 264, "adjac": 264, "pixel": 264, "thompson": 264, "goroshin": 264, "jain": 264, "lecun": 264, "bregler": 264, "2015": [264, 365, 367], "cvpr": 264, "ndhwc": 265, "dhwc": 265, "medic": 265, "video": 265, "num_embed": 266, "lookup": 266, "usual": [266, 385, 389], "vocabulari": 266, "approx": 267, "unit": [267, 268, 302, 304, 306, 313, 314, 315, 316, 320, 321, 322, 323, 324, 326, 345, 346, 347, 349], "phi": [267, 321], "geluapprox": 267, "sigma": [267, 268, 271, 313, 314, 315, 316, 322, 323, 324, 327, 348, 349], "60033": [267, 322], "0433603": [267, 322], "gelufast": 267, "773": 267, "regard": 267, "input_s": [268, 271, 301], "hidden_s": [268, 271, 301], "gate": [268, 324], "recurr": [268, 271, 301], "nld": [268, 271, 301], "ld": [268, 271, 301], "r_t": 268, "xr": 268, "x_t": [268, 271, 301], "hr": 268, "h_t": [268, 271, 301], "b_": [268, 271], "z_t": 268, "xz": 268, "hz": 268, "n_t": 268, "xn": 268, "odot": [268, 271], "hn": 268, "hidden": [268, 271, 301, 310], "nh": [268, 271, 301], "nlh": [268, 271, 301], "lh": [268, 271, 301], "num_group": 269, "pytorch_compat": 269, "split": [269, 324], "preced": 269, "org": [269, 270, 272, 276, 300, 323, 343], "1803": 269, "08494": 269, "denomin": [270, 330, 362, 364, 365, 366, 367, 373], "inorm": 270, "1607": [270, 272], "08022": 270, "i_t": 271, "xi": 271, "f_t": 271, "xf": 271, "hf": 271, "g_t": [271, 362, 364, 365, 366, 367, 368, 373, 374], "xg": 271, "hg": 271, "o_t": 271, "xo": 271, "ho": 271, "c_": [271, 368], "c_t": [271, 368], "cell": 271, "06450": 272, "mathcal": 273, "d_i": 273, "max_": [274, 275], "1908": [276, 343], "08681": [276, 343], "map_fn": [277, 281], "filter_fn": [277, 281], "valid_parameter_filt": 277, "apply_fn": 278, "descend": 279, "is_leaf_fn": 281, "found": 281, "drop": 281, "idempot": [282, 294], "endswith": 282, "file_or_weight": 284, "miss": [284, 392], "ok": [284, 387], "save_safetensor": [288, 392], "predic": 289, "reflect": [290, 386, 388, 390], "certain": [1, 291, 386], "ie": 294, "noop": 294, "unfrozen": 294, "tracer": 295, "partial": [295, 296, 386, 389], "child": 296, "flexibli": 296, "programmat": 296, "query_input_dim": 297, "key_input_dim": 297, "value_input_dim": 297, "value_dim": 297, "value_output_dim": 297, "aggreg": 297, "linearli": 297, "attend": 297, "num_paramet": 298, "25": [298, 311], "parametr": [298, 344], "classmethod": 299, "from_linear": 299, "quantize_modul": 299, "accumul": 300, "1910": 300, "07467": 300, "nonlinear": [301, 386], "elman": 301, "ih": 301, "hh": 301, "func": 301, "rectifi": [302, 315, 316, 326, 345, 346], "10000": 303, "slightli": [303, 393], "plain": 305, "known": [306, 349], "swish": [306, 349], "min_freq": 307, "0001": 307, "max_freq": 307, "cos_first": 307, "full_turn": 307, "sinusoid": 307, "sin": [307, 387, 391], "lambd": [308, 352], "threshold": [309, 334, 341, 353], "geq": [309, 353], "num_encoder_lay": 310, "num_decoder_lay": 310, "nb_func": 310, "custom_encod": 310, "custom_decod": 310, "norm_first": 310, "checkpoint": 310, "decod": 310, "interact": 310, "mechan": 310, "chekpoint": 310, "usag": [310, 386], "expens": 310, "scale_factor": 311, "nearest": 311, "align_corn": 311, "audio": 311, "4d": 311, "forth": 311, "neighbor": 311, "interpol": 311, "bilinear": 311, "trilinear": 311, "corner": 311, "bottom": 311, "squeez": [311, 386], "75": 311, "33333": 311, "66667": 311, "init_fn": [312, 313, 314, 315, 316, 317, 318, 319, 356], "glorot": [313, 314], "fan_in": [313, 314, 315, 316], "fan_out": [313, 314, 315, 316], "fan": [313, 314, 315, 316], "_in": [313, 314], "_out": [313, 314], "difficulti": [313, 314], "feedforward": [313, 314], "191107": 313, "61278": 313, "150594": 313, "363207": 313, "gain": [313, 314, 315, 316], "89613": 313, "53947": 313, "48095": 313, "995016": 313, "223404": 314, "890597": 314, "379159": 314, "776856": 314, "90041": 314, "02264": 314, "912766": 314, "12451": 314, "delv": [315, 316], "surpass": [315, 316], "human": [315, 316], "level": [315, 316], "imagenet": [315, 316], "classif": [315, 316], "25211": 315, "458835": 315, "177208": 315, "0137595": 315, "6967": 315, "02765": 315, "15268": 315, "75787": 315, "kaim": 316, "0300242": 316, "0184009": 316, "793615": 316, "666329": 316, "64331": 316, "16506": 316, "08619": 316, "79854": 316, "982273": 318, "534422": 318, "380709": 318, "0645099": 318, "883935": 319, "863726": 319, "617261": 319, "417497": 319, "exact": [322, 323], "0003": 322, "cdot": [322, 323, 330, 333, 349], "015": 323, "702": 323, "hendryck": 323, "1606": 323, "08415": 323, "halv": 324, "negative_slop": 326, "leaki": 326, "sum_i": 328, "x_i": [328, 350], "with_logit": 329, "predict": [329, 332, 333, 334, 335, 336, 337, 339, 340, 341], "105361": 329, "223144": 329, "20397": 329, "916291": 329, "539245": 329, "prob": 329, "510826": 329, "x1": 330, "x2": 330, "x_1": [330, 338], "x_2": [330, 338], "label_smooth": 331, "hot": 331, "smooth": [331, 341, 373], "0485873": 331, "348587": 331, "06": [332, 342, 362], "likelihood": [332, 340], "nll": [332, 340], "hing": 333, "y_": [333, 337], "pred": [333, 337], "delta": [334, 362], "huber": 334, "leq": [334, 347], "l2": [334, 337, 374], "kullback": 335, "leibler": 335, "diverg": 335, "cosh": 337, "logcosh": 337, "sensit": 337, "outlier": 337, "dual": 337, "behavior": [190, 337, 388, 389], "offer": 337, "balanc": 337, "robust": 337, "approach": [337, 387], "inputs1": 338, "inputs2": 338, "margin": [338, 342], "rank": 338, "573409": 338, "765166": 338, "0638": 338, "75596": 338, "225763": 338, "256995": 338, "773433": 338, "formula": 341, "anchor": 342, "triplet": 342, "_p": 342, "degre": 342, "pairwis": 342, "instabl": 342, "monoton": 343, "0507": 347, "67326": 347, "sum_j": 350, "x_j": 350, "subclass": 359, "concept": 359, "mymlp": 359, "in_proj": 359, "subsequ": 361, "apply_gradi": 361, "rmsprop": 361, "adagrad": 361, "adafactor": 361, "adadelta": 361, "adam": [361, 367, 368, 377, 378], "adamw": [361, 368], "adamax": 361, "lion": 361, "cosine_decai": [361, 377], "exponential_decai": 361, "join_schedul": 361, "linear_schedul": [361, 377], "step_decai": 361, "rho": 362, "zeiler": 362, "2012": [362, 373], "adapt": [362, 363, 364], "1212": 362, "5701": 362, "v_": [362, 364, 365, 366, 367, 373, 374], "v_t": [362, 364, 365, 366, 367, 373, 374], "u_t": 362, "u_": 362, "w_t": [362, 364, 365, 366, 367, 368, 373, 374], "001": 363, "clip_threshold": 363, "decay_r": [363, 376, 379], "beta_1": [363, 365, 366, 367, 368], "weight_decai": [363, 366, 368, 374], "scale_paramet": 363, "relative_step": 363, "warmup_init": 363, "sublinear": 363, "cost": [363, 389], "epsilon_1": 363, "epsilon_2": 363, "parameter_scal": 363, "clip": 363, "unscal": 363, "decai": [363, 366, 368, 374, 375, 376, 379], "duchi": 364, "hazan": 364, "singer": 364, "2011": 364, "subgradi": 364, "onlin": 364, "stochast": [364, 365, 367, 374, 389], "jmlr": 364, "999": [365, 366, 367], "omit": [365, 367], "estim": [365, 367], "kingma": [365, 367], "ba": [365, 367], "iclr": [365, 366, 367], "m_": [365, 366, 367, 368], "m_t": [365, 366, 367, 368], "beta_2": [365, 366, 367, 368], "contrast": 366, "loshchilov": 366, "hutter": 366, "decoupl": 366, "99": [368, 373], "tend": 368, "10x": 368, "strength": [368, 374], "wd": 368, "chen": 368, "symbol": 368, "discoveri": 368, "2302": 368, "06675": 368, "eta": 368, "opt": 369, "tieleman": 373, "hinton": 373, "lectur": 373, "coursera": 373, "dampen": 374, "nesterov": 374, "descent": [374, 386, 389], "mu": 374, "tau": 374, "penalti": 374, "decay_step": 375, "beyond": [375, 378], "minim": 375, "lr_schedul": [375, 376, 377, 379], "1000": [375, 386], "0999961": 375, "06561": 376, "boundari": 377, "join": 377, "receiv": [377, 390], "transit": 377, "warmup": [377, 378], "0999938": 377, "101": 378, "step_siz": 379, "081": 379, "basi": 381, "implicit": [383, 386, 387], "fine": [383, 389], "grain": 383, "control": [383, 389], "pseudo": 383, "altern": 383, "splittabl": 383, "threefri": 383, "counter": 383, "cycl": 385, "merg": 386, "fuse": 386, "big": 386, "awar": [386, 389], "36788": 386, "compiled_fun": 386, "code": [386, 389], "slow": 386, "stack": 386, "rerun": [386, 389], "frequent": [386, 389], "destroi": 386, "anonym": 386, "don": [386, 393], "unari": 386, "overhead": [386, 389, 393], "bandwidth": 386, "fusibl": 386, "consider": 386, "versu": 386, "timeit": [386, 387], "tic": 386, "perf_count": 386, "toc": 386, "tpi": 386, "1e3": 386, "4096": [386, 387, 393], "On": [386, 387, 389], "millisecond": [386, 393], "five": 386, "latest": 386, "won": 386, "placehold": 386, "insid": 386, "crash": 386, "disable_compil": 386, "okai": [386, 389], "intend": 386, "deal": 386, "pretti": [386, 389], "inconveni": 386, "functool": 386, "particularli": 386, "backward": [386, 387], "compiled_grad_fn": 386, "71828": 386, "outer": [386, 389], "opportun": 386, "idea": [387, 389], "behind": 387, "dfdx": [387, 388], "d2fdx2": 387, "zero_grad": 387, "detach": 387, "requires_grad": 387, "dloss_dw": 387, "dloss_dx": 387, "lot": 387, "redund": 387, "suppos": [387, 393], "nice": [387, 389], "propag": [387, 388], "stop_gradi": 387, "autom": 387, "contriv": [387, 393], "sake": 387, "clariti": 387, "quit": [387, 390], "power": [387, 390], "difficult": 387, "primit": 387, "issu": [387, 390], "priorit": 387, "naive_add": 387, "vmap_add": 387, "total": 387, "390": 387, "wherea": 387, "025": 387, "ten": [387, 389], "Of": 387, "better": [387, 393], "handi": 387, "slice": 388, "ellipsi": 388, "mix": 388, "take_along_axi": 388, "lack": 388, "extrem": [388, 389], "ineffici": [388, 389], "nonzero": 388, "dynam": 389, "easier": 389, "worri": 389, "fun1": 389, "expensive_fun": 389, "consum": 389, "eager": 389, "thank": 389, "weights_fp16": 389, "trade": 389, "bad": 389, "grow": 389, "computation": 389, "costli": 389, "wide": 389, "thousand": 389, "value_and_grad_fn": 389, "implicitli": 389, "anytim": 389, "memoryview": [389, 390], "perfectli": 389, "first_lay": 389, "second_layer_a": 389, "second_layer_b": 389, "protocol": 390, "pep": 390, "3118": 390, "a_view": 390, "owndata": 390, "extern": 390, "x_view": 390, "modifi": 390, "df": 390, "x\u00b2": 390, "2x": 390, "indirectli": 390, "modif": 390, "seen": 390, "occur": 390, "incorpor": 390, "incorrect": 390, "experiment": 390, "break": 390, "advis": 390, "intermedi": 390, "jnp": 390, "tf": 390, "page": 391, "composit": 391, "archiv": 392, "savez_compress": 392, "save_gguf": 392, "arr_0": 392, "advantag": 393, "parallel": 393, "race": 393, "interest": 393, "albeit": 393, "d1": 393, "d2": 393, "matmul": 393, "dens": [163, 393], "twice": 393, "measur": 393, "default_stream": 394, "default_devic": 394, "my_devic": 394, "explain": 1, "underli": 1, "tutori": 1, "cover": 1, "front": 1, "virtual": 1, "reimplement": 1, "finish": 1, "command_buff": 1, "mtlcommandbuff": 1, "unus": 1, "nb_modul": 1, "_ext": 1, "nb": 1, "nanobind_add_modul": 1, "nb_static": 1, "stable_abi": 1, "lto": 1, "nomins": 1, "nb_domain": 1, "extras_requir": 1, "cmake_arg": 2, "mtl_capture_en": 2, "trace_fil": 2, "mlx_trace": 2, "exit": 2, "minu": 110, "spars": 163, "xy": 163, "multidimension": 163, "coordin": 163, "cartesian": 163, "ij": 163, "successfulli": 170, "cov": 190, "jointli": 190, "semi": 190, "definit": 190, "empti": 190, "cubic": 311, "bicub": 311}, "objects": {"mlx.core": [[8, 0, 1, "", "Device"], [9, 0, 1, "", "Dtype"], [10, 0, 1, "", "DtypeCategory"], [248, 0, 1, "", "Stream"], [11, 2, 1, "", "abs"], [12, 2, 1, "", "add"], [13, 2, 1, "", "all"], [14, 2, 1, "", "allclose"], [15, 2, 1, "", "any"], [16, 2, 1, "", "arange"], [17, 2, 1, "", "arccos"], [18, 2, 1, "", "arccosh"], [19, 2, 1, "", "arcsin"], [20, 2, 1, "", "arcsinh"], [21, 2, 1, "", "arctan"], [22, 2, 1, "", "arctanh"], [23, 2, 1, "", "argmax"], [24, 2, 1, "", "argmin"], [25, 2, 1, "", "argpartition"], [26, 2, 1, "", "argsort"], [27, 0, 1, "", "array"], [76, 2, 1, "", "array_equal"], [77, 2, 1, "", "atleast_1d"], [78, 2, 1, "", "atleast_2d"], [79, 2, 1, "", "atleast_3d"], [80, 2, 1, "", "broadcast_to"], [81, 2, 1, "", "ceil"], [82, 2, 1, "", "clip"], [83, 2, 1, "", "compile"], [84, 2, 1, "", "concatenate"], [85, 2, 1, "", "conv1d"], [86, 2, 1, "", "conv2d"], [87, 2, 1, "", "conv_general"], [88, 2, 1, "", "convolve"], [89, 2, 1, "", "cos"], [90, 2, 1, "", "cosh"], [91, 2, 1, "", "cummax"], [92, 2, 1, "", "cummin"], [93, 2, 1, "", "cumprod"], [94, 2, 1, "", "cumsum"], [95, 2, 1, "", "default_device"], [96, 2, 1, "", "default_stream"], [97, 2, 1, "", "dequantize"], [98, 2, 1, "", "diag"], [99, 2, 1, "", "diagonal"], [100, 2, 1, "", "disable_compile"], [101, 2, 1, "", "divide"], [102, 2, 1, "", "divmod"], [103, 2, 1, "", "enable_compile"], [104, 2, 1, "", "equal"], [105, 2, 1, "", "erf"], [106, 2, 1, "", "erfinv"], [107, 2, 1, "", "eval"], [108, 2, 1, "", "exp"], [109, 2, 1, "", "expand_dims"], [110, 2, 1, "", "expm1"], [111, 2, 1, "", "eye"], [128, 2, 1, "", "flatten"], [129, 2, 1, "", "floor"], [130, 2, 1, "", "floor_divide"], [131, 2, 1, "", "full"], [132, 2, 1, "", "grad"], [133, 2, 1, "", "greater"], [134, 2, 1, "", "greater_equal"], [135, 2, 1, "", "identity"], [136, 2, 1, "", "inner"], [137, 2, 1, "", "isclose"], [138, 2, 1, "", "isinf"], [139, 2, 1, "", "isnan"], [140, 2, 1, "", "isneginf"], [141, 2, 1, "", "isposinf"], [142, 2, 1, "", "issubdtype"], [143, 2, 1, "", "jvp"], [144, 2, 1, "", "less"], [145, 2, 1, "", "less_equal"], [148, 2, 1, "", "linspace"], [149, 2, 1, "", "load"], [150, 2, 1, "", "log"], [151, 2, 1, "", "log10"], [152, 2, 1, "", "log1p"], [153, 2, 1, "", "log2"], [154, 2, 1, "", "logaddexp"], [155, 2, 1, "", "logical_and"], [156, 2, 1, "", "logical_not"], [157, 2, 1, "", "logical_or"], [158, 2, 1, "", "logsumexp"], [159, 2, 1, "", "matmul"], [160, 2, 1, "", "max"], [161, 2, 1, "", "maximum"], [162, 2, 1, "", "mean"], [163, 2, 1, "", "meshgrid"], [172, 2, 1, "", "min"], [173, 2, 1, "", "minimum"], [174, 2, 1, "", "moveaxis"], [175, 2, 1, "", "multiply"], [176, 2, 1, "", "negative"], [177, 2, 1, "", "new_stream"], [178, 2, 1, "", "ones"], [179, 2, 1, "", "ones_like"], [180, 2, 1, "", "outer"], [181, 2, 1, "", "pad"], [182, 2, 1, "", "partition"], [183, 2, 1, "", "prod"], [184, 2, 1, "", "quantize"], [185, 2, 1, "", "quantized_matmul"], [197, 2, 1, "", "reciprocal"], [198, 2, 1, "", "repeat"], [199, 2, 1, "", "reshape"], [200, 2, 1, "", "round"], [201, 2, 1, "", "rsqrt"], [202, 2, 1, "", "save"], [203, 2, 1, "", "save_gguf"], [204, 2, 1, "", "save_safetensors"], [205, 2, 1, "", "savez"], [206, 2, 1, "", "savez_compressed"], [207, 2, 1, "", "set_default_device"], [208, 2, 1, "", "set_default_stream"], [209, 2, 1, "", "sigmoid"], [210, 2, 1, "", "sign"], [211, 2, 1, "", "sin"], [212, 2, 1, "", "sinh"], [213, 2, 1, "", "softmax"], [214, 2, 1, "", "sort"], [215, 2, 1, "", "split"], [216, 2, 1, "", "sqrt"], [217, 2, 1, "", "square"], [218, 2, 1, "", "squeeze"], [219, 2, 1, "", "stack"], [220, 2, 1, "", "std"], [221, 2, 1, "", "stop_gradient"], [222, 2, 1, "", "stream"], [223, 2, 1, "", "subtract"], [224, 2, 1, "", "sum"], [225, 2, 1, "", "swapaxes"], [226, 2, 1, "", "take"], [227, 2, 1, "", "take_along_axis"], [228, 2, 1, "", "tan"], [229, 2, 1, "", "tanh"], [230, 2, 1, "", "tensordot"], [231, 2, 1, "", "tile"], [232, 2, 1, "", "topk"], [233, 2, 1, "", "transpose"], [234, 2, 1, "", "tri"], [235, 2, 1, "", "tril"], [236, 2, 1, "", "triu"], [237, 2, 1, "", "value_and_grad"], [238, 2, 1, "", "var"], [239, 2, 1, "", "vjp"], [240, 2, 1, "", "vmap"], [241, 2, 1, "", "where"], [242, 2, 1, "", "zeros"], [243, 2, 1, "", "zeros_like"]], "mlx.core.Device": [[8, 1, 1, "", "__init__"]], "mlx.core.Dtype": [[9, 1, 1, "", "__init__"]], "mlx.core.DtypeCategory": [[10, 1, 1, "", "__init__"]], "mlx.core.Stream": [[248, 1, 1, "", "__init__"]], "mlx.core.array": [[28, 3, 1, "", "T"], [27, 1, 1, "", "__init__"], [29, 1, 1, "", "abs"], [30, 1, 1, "", "all"], [31, 1, 1, "", "any"], [32, 1, 1, "", "argmax"], [33, 1, 1, "", "argmin"], [34, 1, 1, "", "astype"], [35, 3, 1, "", "at"], [36, 1, 1, "", "cos"], [37, 1, 1, "", "cummax"], [38, 1, 1, "", "cummin"], [39, 1, 1, "", "cumprod"], [40, 1, 1, "", "cumsum"], [41, 1, 1, "", "diag"], [42, 1, 1, "", "diagonal"], [43, 3, 1, "", "dtype"], [44, 1, 1, "", "exp"], [45, 1, 1, "", "flatten"], [46, 1, 1, "", "item"], [47, 3, 1, "", "itemsize"], [48, 1, 1, "", "log"], [49, 1, 1, "", "log10"], [50, 1, 1, "", "log1p"], [51, 1, 1, "", "log2"], [52, 1, 1, "", "logsumexp"], [53, 1, 1, "", "max"], [54, 1, 1, "", "mean"], [55, 1, 1, "", "min"], [56, 1, 1, "", "moveaxis"], [57, 3, 1, "", "nbytes"], [58, 3, 1, "", "ndim"], [59, 1, 1, "", "prod"], [60, 1, 1, "", "reciprocal"], [61, 1, 1, "", "reshape"], [62, 1, 1, "", "round"], [63, 1, 1, "", "rsqrt"], [64, 3, 1, "", "shape"], [65, 1, 1, "", "sin"], [66, 3, 1, "", "size"], [67, 1, 1, "", "split"], [68, 1, 1, "", "sqrt"], [69, 1, 1, "", "square"], [70, 1, 1, "", "squeeze"], [71, 1, 1, "", "sum"], [72, 1, 1, "", "swapaxes"], [73, 1, 1, "", "tolist"], [74, 1, 1, "", "transpose"], [75, 1, 1, "", "var"]], "mlx.core.fast": [[112, 2, 1, "", "layer_norm"], [113, 2, 1, "", "rms_norm"], [114, 2, 1, "", "rope"], [115, 2, 1, "", "scaled_dot_product_attention"]], "mlx.core.fft": [[116, 2, 1, "", "fft"], [117, 2, 1, "", "fft2"], [118, 2, 1, "", "fftn"], [119, 2, 1, "", "ifft"], [120, 2, 1, "", "ifft2"], [121, 2, 1, "", "ifftn"], [122, 2, 1, "", "irfft"], [123, 2, 1, "", "irfft2"], [124, 2, 1, "", "irfftn"], [125, 2, 1, "", "rfft"], [126, 2, 1, "", "rfft2"], [127, 2, 1, "", "rfftn"]], "mlx.core.linalg": [[146, 2, 1, "", "norm"], [147, 2, 1, "", "qr"]], "mlx.core.metal": [[164, 2, 1, "", "get_active_memory"], [165, 2, 1, "", "get_cache_memory"], [166, 2, 1, "", "get_peak_memory"], [167, 2, 1, "", "is_available"], [168, 2, 1, "", "set_cache_limit"], [169, 2, 1, "", "set_memory_limit"], [170, 2, 1, "", "start_capture"], [171, 2, 1, "", "stop_capture"]], "mlx.core.random": [[186, 2, 1, "", "bernoulli"], [187, 2, 1, "", "categorical"], [188, 2, 1, "", "gumbel"], [189, 2, 1, "", "key"], [190, 2, 1, "", "multivariate_normal"], [191, 2, 1, "", "normal"], [192, 2, 1, "", "randint"], [193, 2, 1, "", "seed"], [194, 2, 1, "", "split"], [195, 2, 1, "", "truncated_normal"], [196, 2, 1, "", "uniform"]], "mlx.nn": [[257, 0, 1, "", "ALiBi"], [258, 0, 1, "", "AvgPool1d"], [259, 0, 1, "", "AvgPool2d"], [260, 0, 1, "", "BatchNorm"], [261, 0, 1, "", "Conv1d"], [262, 0, 1, "", "Conv2d"], [263, 0, 1, "", "Dropout"], [264, 0, 1, "", "Dropout2d"], [265, 0, 1, "", "Dropout3d"], [266, 0, 1, "", "Embedding"], [267, 0, 1, "", "GELU"], [268, 0, 1, "", "GRU"], [269, 0, 1, "", "GroupNorm"], [270, 0, 1, "", "InstanceNorm"], [271, 0, 1, "", "LSTM"], [272, 0, 1, "", "LayerNorm"], [273, 0, 1, "", "Linear"], [274, 0, 1, "", "MaxPool1d"], [275, 0, 1, "", "MaxPool2d"], [276, 0, 1, "", "Mish"], [359, 0, 1, "", "Module"], [297, 0, 1, "", "MultiHeadAttention"], [298, 0, 1, "", "PReLU"], [299, 0, 1, "", "QuantizedLinear"], [300, 0, 1, "", "RMSNorm"], [301, 0, 1, "", "RNN"], [302, 0, 1, "", "ReLU"], [303, 0, 1, "", "RoPE"], [304, 0, 1, "", "SELU"], [305, 0, 1, "", "Sequential"], [306, 0, 1, "", "SiLU"], [307, 0, 1, "", "SinusoidalPositionalEncoding"], [308, 0, 1, "", "Softshrink"], [309, 0, 1, "", "Step"], [310, 0, 1, "", "Transformer"], [311, 0, 1, "", "Upsample"], [320, 2, 1, "", "elu"], [321, 2, 1, "", "gelu"], [322, 2, 1, "", "gelu_approx"], [323, 2, 1, "", "gelu_fast_approx"], [324, 2, 1, "", "glu"], [325, 2, 1, "", "hardswish"], [326, 2, 1, "", "leaky_relu"], [327, 2, 1, "", "log_sigmoid"], [328, 2, 1, "", "log_softmax"], [343, 2, 1, "", "mish"], [344, 2, 1, "", "prelu"], [345, 2, 1, "", "relu"], [346, 2, 1, "", "relu6"], [347, 2, 1, "", "selu"], [348, 2, 1, "", "sigmoid"], [349, 2, 1, "", "silu"], [350, 2, 1, "", "softmax"], [351, 2, 1, "", "softplus"], [352, 2, 1, "", "softshrink"], [353, 2, 1, "", "step"], [354, 2, 1, "", "tanh"], [244, 2, 1, "", "value_and_grad"]], "mlx.nn.Module": [[277, 1, 1, "", "apply"], [278, 1, 1, "", "apply_to_modules"], [279, 1, 1, "", "children"], [280, 1, 1, "", "eval"], [281, 1, 1, "", "filter_and_map"], [282, 1, 1, "", "freeze"], [283, 1, 1, "", "leaf_modules"], [284, 1, 1, "", "load_weights"], [285, 1, 1, "", "modules"], [286, 1, 1, "", "named_modules"], [287, 1, 1, "", "parameters"], [288, 1, 1, "", "save_weights"], [289, 1, 1, "", "set_dtype"], [290, 3, 1, "", "state"], [291, 1, 1, "", "train"], [292, 1, 1, "", "trainable_parameters"], [293, 3, 1, "", "training"], [294, 1, 1, "", "unfreeze"], [295, 1, 1, "", "update"], [296, 1, 1, "", "update_modules"]], "mlx.nn.init": [[312, 2, 1, "", "constant"], [313, 2, 1, "", "glorot_normal"], [314, 2, 1, "", "glorot_uniform"], [315, 2, 1, "", "he_normal"], [316, 2, 1, "", "he_uniform"], [317, 2, 1, "", "identity"], [318, 2, 1, "", "normal"], [319, 2, 1, "", "uniform"]], "mlx.nn.losses": [[329, 2, 1, "", "binary_cross_entropy"], [330, 2, 1, "", "cosine_similarity_loss"], [331, 2, 1, "", "cross_entropy"], [332, 2, 1, "", "gaussian_nll_loss"], [333, 2, 1, "", "hinge_loss"], [334, 2, 1, "", "huber_loss"], [335, 2, 1, "", "kl_div_loss"], [336, 2, 1, "", "l1_loss"], [337, 2, 1, "", "log_cosh_loss"], [338, 2, 1, "", "margin_ranking_loss"], [339, 2, 1, "", "mse_loss"], [340, 2, 1, "", "nll_loss"], [341, 2, 1, "", "smooth_l1_loss"], [342, 2, 1, "", "triplet_loss"]], "mlx.optimizers": [[362, 0, 1, "", "AdaDelta"], [363, 0, 1, "", "Adafactor"], [364, 0, 1, "", "Adagrad"], [365, 0, 1, "", "Adam"], [366, 0, 1, "", "AdamW"], [367, 0, 1, "", "Adamax"], [368, 0, 1, "", "Lion"], [381, 0, 1, "", "Optimizer"], [373, 0, 1, "", "RMSprop"], [374, 0, 1, "", "SGD"], [375, 2, 1, "", "cosine_decay"], [376, 2, 1, "", "exponential_decay"], [377, 2, 1, "", "join_schedules"], [378, 2, 1, "", "linear_schedule"], [379, 2, 1, "", "step_decay"]], "mlx.optimizers.Optimizer": [[369, 1, 1, "", "apply_gradients"], [370, 1, 1, "", "init"], [371, 3, 1, "", "state"], [372, 1, 1, "", "update"]], "mlx.utils": [[245, 2, 1, "", "tree_flatten"], [246, 2, 1, "", "tree_map"], [247, 2, 1, "", "tree_unflatten"]]}, "objtypes": {"0": "py:class", "1": "py:method", "2": "py:function", "3": "py:property"}, "objnames": {"0": ["py", "class", "Python class"], "1": ["py", "method", "Python method"], "2": ["py", "function", "Python function"], "3": ["py", "property", "Python property"]}, "titleterms": {"oper": [0, 1, 360], "develop": 1, "document": 1, "introduc": 1, "exampl": [1, 6, 386, 393], "primit": 1, "us": [1, 389, 394], "implement": [1, 4], "cpu": 1, "backend": [], "gpu": 1, "transform": [1, 310, 384, 386, 387, 389, 391], "build": [1, 7], "bind": 1, "python": [1, 6, 7], "cmake": 1, "setuptool": 1, "usag": [1, 6], "result": 1, "script": [1, 4], "download": [1, 4], "code": [1, 4], "metal": [2, 7, 164, 165, 166, 167, 168, 169, 170, 171, 255], "debugg": 2, "xcode": 2, "workflow": 2, "linear": [3, 254, 273], "regress": 3, "llm": 4, "infer": 4, "model": 4, "attent": 4, "layer": [4, 5, 357], "encod": 4, "full": [4, 131], "gener": 4, "put": 4, "all": [4, 13, 30], "togeth": 4, "convert": 4, "weight": 4, "load": [4, 149, 392], "benchmark": 4, "multi": 5, "perceptron": 5, "mlx": [6, 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, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379], "instal": [6, 7], "api": [6, 7], "refer": 6, "c": [6, 7], "further": 6, "read": 6, "troubleshoot": 7, "from": [7, 388], "sourc": 7, "requir": 7, "option": 7, "found": 7, "x86": 7, "shell": 7, "core": [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, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 248], "devic": [8, 251], "dtype": [9, 43], "dtypecategori": 10, "ab": [11, 29], "add": 12, "allclos": 14, "ani": [15, 31], "arang": 16, "arcco": 17, "arccosh": 18, "arcsin": 19, "arcsinh": 20, "arctan": 21, "arctanh": 22, "argmax": [23, 32], "argmin": [24, 33], "argpartit": 25, "argsort": 26, "arrai": [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, 249, 388, 392], "t": 28, "astyp": 34, "co": [36, 89], "cummax": [37, 91], "cummin": [38, 92], "cumprod": [39, 93], "cumsum": [40, 94], "diag": [41, 98], "diagon": [42, 99], "exp": [44, 108], "flatten": [45, 128], "item": 46, "items": 47, "log": [48, 150], "log10": [49, 151], "log1p": [50, 152], "log2": [51, 153], "logsumexp": [52, 158], "max": [53, 160], "mean": [54, 162], "min": [55, 172], "moveaxi": [56, 174], "nbyte": 57, "ndim": 58, "prod": [59, 183], "reciproc": [60, 197], "reshap": [61, 199], "round": [62, 200], "rsqrt": [63, 201], "shape": 64, "sin": [65, 211], "size": 66, "split": [67, 194, 215], "sqrt": [68, 216], "squar": [69, 217], "squeez": [70, 218], "sum": [71, 224], "swapax": [72, 225], "tolist": 73, "transpos": [74, 233], "var": [75, 238], "array_equ": 76, "atleast_1d": 77, "atleast_2d": 78, "atleast_3d": 79, "broadcast_to": 80, "ceil": 81, "clip": 82, "compil": [83, 386], "concaten": 84, "conv1d": [85, 261], "conv2d": [86, 262], "conv_gener": 87, "convolv": 88, "cosh": 90, "default_devic": 95, "default_stream": 96, "dequant": 97, "disable_compil": 100, "divid": 101, "divmod": 102, "enable_compil": 103, "equal": 104, "erf": 105, "erfinv": 106, "eval": [107, 280], "expand_dim": 109, "ey": 111, "fast": [112, 113, 114, 115, 252], "layer_norm": 112, "rms_norm": 113, "rope": [114, 303], "scaled_dot_product_attent": 115, "fft": [116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 253], "fft2": 117, "fftn": 118, "ifft": 119, "ifft2": 120, "ifftn": 121, "irfft": 122, "irfft2": 123, "irfftn": 124, "rfft": 125, "rfft2": 126, "rfftn": 127, "floor": 129, "floor_divid": 130, "grad": [132, 256], "greater": 133, "greater_equ": 134, "ident": [135, 317], "inner": 136, "isclos": 137, "isinf": 138, "isnan": 139, "isneginf": 140, "isposinf": 141, "issubdtyp": 142, "jvp": 143, "less": 144, "less_equ": 145, "linalg": [146, 147], "norm": 146, "qr": 147, "linspac": 148, "logaddexp": 154, "logical_and": 155, "logical_not": 156, "logical_or": 157, "matmul": 159, "maximum": 161, "get_active_memori": 164, "get_cache_memori": 165, "get_peak_memori": 166, "is_avail": 167, "set_cache_limit": 168, "set_memory_limit": 169, "minimum": 173, "multipli": 175, "neg": 176, "new_stream": 177, "ones": 178, "ones_lik": 179, "outer": 180, "pad": 181, "partit": 182, "quantiz": 184, "quantized_matmul": 185, "random": [186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 383], "bernoulli": 186, "categor": 187, "gumbel": 188, "kei": 189, "normal": [191, 318], "randint": 192, "seed": 193, "truncated_norm": 195, "uniform": [196, 319], "repeat": 198, "save": [202, 392], "save_gguf": 203, "save_safetensor": 204, "savez": 205, "savez_compress": 206, "set_default_devic": 207, "set_default_stream": 208, "sigmoid": [209, 348], "sign": 210, "sinh": 212, "softmax": [213, 350], "sort": 214, "stack": 219, "stop_gradi": 221, "stream": [222, 248, 251, 394], "subtract": 223, "take": 226, "take_along_axi": 227, "tan": 228, "tanh": [229, 354], "tensordot": 230, "tile": 231, "topk": 232, "tri": 234, "tril": 235, "triu": 236, "value_and_grad": [237, 244], "vjp": 239, "vmap": 240, "where": 241, "zero": 242, "zeros_lik": 243, "nn": [244, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354], "util": [245, 246, 247, 385], "tree_flatten": 245, "tree_map": 246, "tree_unflatten": 247, "data": 250, "type": 250, "support": 250, "algebra": 254, "neural": 256, "network": 256, "quick": [256, 391], "start": [256, 391], "The": 256, "modul": [256, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 359], "class": 256, "paramet": [256, 287], "updat": [256, 295, 372, 388], "inspect": 256, "valu": 256, "alibi": 257, "avgpool1d": 258, "avgpool2d": 259, "batchnorm": 260, "dropout": 263, "dropout2d": 264, "dropout3d": 265, "embed": 266, "gelu": [267, 321], "gru": 268, "groupnorm": 269, "instancenorm": 270, "lstm": 271, "layernorm": 272, "maxpool1d": 274, "maxpool2d": 275, "mish": [276, 343], "appli": 277, "apply_to_modul": 278, "children": 279, "filter_and_map": 281, "freez": 282, "leaf_modul": 283, "load_weight": 284, "named_modul": 286, "save_weight": 288, "set_dtyp": 289, "state": [290, 371], "train": [291, 293, 386], "trainable_paramet": 292, "unfreez": 294, "update_modul": 296, "multiheadattent": 297, "prelu": [298, 344], "quantizedlinear": 299, "rmsnorm": 300, "rnn": 301, "relu": [302, 345], "selu": [304, 347], "sequenti": 305, "silu": [306, 349], "sinusoidalpositionalencod": 307, "softshrink": [308, 352], "step": [309, 353], "upsampl": 311, "init": [312, 313, 314, 315, 316, 317, 318, 319, 370], "constant": 312, "glorot_norm": 313, "glorot_uniform": 314, "he_norm": 315, "he_uniform": 316, "elu": 320, "gelu_approx": 322, "gelu_fast_approx": 323, "glu": 324, "hardswish": 325, "leaky_relu": 326, "log_sigmoid": 327, "log_softmax": 328, "loss": [329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 358], "binary_cross_entropi": 329, "cosine_similarity_loss": 330, "cross_entropi": 331, "gaussian_nll_loss": 332, "hinge_loss": 333, "huber_loss": 334, "kl_div_loss": 335, "l1_loss": 336, "log_cosh_loss": 337, "margin_ranking_loss": 338, "mse_loss": 339, "nll_loss": 340, "smooth_l1_loss": 341, "triplet_loss": 342, "relu6": 346, "softplu": 351, "function": [355, 358, 386, 387, 391], "initi": 356, "optim": [361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381], "adadelta": 362, "adafactor": 363, "adagrad": 364, "adam": 365, "adamw": 366, "adamax": 367, "lion": 368, "apply_gradi": 369, "rmsprop": 373, "sgd": 374, "cosine_decai": 375, "exponential_decai": 376, "join_schedul": 377, "linear_schedul": 378, "step_decai": 379, "common": 380, "schedul": 382, "tree": 385, "basic": [386, 391], "speedup": 386, "debug": 386, "pure": 386, "graph": [386, 389, 391], "automat": 387, "differenti": 387, "vector": 387, "index": 388, "differ": 388, "numpi": [388, 390], "In": 388, "place": 388, "lazi": 389, "evalu": 389, "why": 389, "comput": 389, "onli": 389, "what": 389, "you": 389, "when": 389, "convers": 390, "other": 390, "framework": 390, "pytorch": 390, "jax": 390, "tensorflow": 390, "guid": 391, "serial": 392, "format": 392, "unifi": 393, "memori": 393, "A": 393, "simpl": 393, "specifi": 394, "back": 1, "end": 1, "expm1": 110, "meshgrid": 163, "start_captur": 170, "stop_captur": 171, "multivariate_norm": 190, "std": 220}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx": 60}, "alltitles": {"Operations": [[0, "operations"], [1, "operations"], [360, "operations"]], "Developer Documentation": [[1, "developer-documentation"]], "Introducing the Example": [[1, "introducing-the-example"]], "Operations and Primitives": [[1, "operations-and-primitives"]], "Primitives": [[1, "primitives"]], "Using the Primitive": [[1, "using-the-primitive"]], "Implementing the Primitive": [[1, "implementing-the-primitive"]], "Implementing the CPU Back-end": [[1, "implementing-the-cpu-back-end"]], "Implementing the GPU Back-end": [[1, "implementing-the-gpu-back-end"]], "Primitive Transforms": [[1, "primitive-transforms"]], "Building and Binding": [[1, "building-and-binding"]], "Binding to Python": [[1, "binding-to-python"]], "Building with CMake": [[1, "building-with-cmake"]], "Building with setuptools": [[1, "building-with-setuptools"]], "Usage": [[1, "usage"], [6, null]], "Results": [[1, "results"]], "Scripts": [[1, "scripts"], [4, "scripts"]], "Download the code": [[1, null], [4, null]], "Metal Debugger": [[2, "metal-debugger"]], "Xcode Workflow": [[2, "xcode-workflow"]], "Linear Regression": [[3, "linear-regression"]], "LLM inference": [[4, "llm-inference"]], "Implementing the model": [[4, "implementing-the-model"]], "Attention layer": [[4, "attention-layer"]], "Encoder layer": [[4, "encoder-layer"]], "Full model": [[4, "full-model"]], "Generation": [[4, "generation"]], "Putting it all together": [[4, "putting-it-all-together"]], "Converting the weights": [[4, "converting-the-weights"]], "Weight loading and benchmarking": [[4, "weight-loading-and-benchmarking"]], "Multi-Layer Perceptron": [[5, "multi-layer-perceptron"]], "MLX": [[6, "mlx"]], "Install": [[6, null]], "Examples": [[6, null]], "Python API Reference": [[6, null]], "C++ API Reference": [[6, null]], "Further Reading": [[6, null]], "Build and Install": [[7, "build-and-install"]], "Python Installation": [[7, "python-installation"]], "Troubleshooting": [[7, "troubleshooting"], [7, "id2"]], "Build from source": [[7, "build-from-source"]], "Build Requirements": [[7, "build-requirements"]], "Python API": [[7, "python-api"]], "C++ API": [[7, "c-api"]], "Build Options": [[7, "id3"]], "Metal not found": [[7, "metal-not-found"]], "x86 Shell": [[7, "x86-shell"]], "mlx.core.Device": [[8, "mlx-core-device"]], "mlx.core.Dtype": [[9, "mlx-core-dtype"]], "mlx.core.DtypeCategory": [[10, "mlx-core-dtypecategory"]], "mlx.core.abs": [[11, "mlx-core-abs"]], "mlx.core.add": [[12, "mlx-core-add"]], "mlx.core.all": [[13, "mlx-core-all"]], "mlx.core.allclose": [[14, "mlx-core-allclose"]], "mlx.core.any": [[15, "mlx-core-any"]], "mlx.core.arange": [[16, "mlx-core-arange"]], "mlx.core.arccos": [[17, "mlx-core-arccos"]], "mlx.core.arccosh": [[18, "mlx-core-arccosh"]], "mlx.core.arcsin": [[19, "mlx-core-arcsin"]], "mlx.core.arcsinh": [[20, "mlx-core-arcsinh"]], "mlx.core.arctan": [[21, "mlx-core-arctan"]], "mlx.core.arctanh": [[22, "mlx-core-arctanh"]], "mlx.core.argmax": [[23, "mlx-core-argmax"]], "mlx.core.argmin": [[24, "mlx-core-argmin"]], "mlx.core.argpartition": [[25, "mlx-core-argpartition"]], "mlx.core.argsort": [[26, "mlx-core-argsort"]], "mlx.core.array": [[27, "mlx-core-array"]], "mlx.core.array.T": [[28, "mlx-core-array-t"]], "mlx.core.array.abs": [[29, "mlx-core-array-abs"]], "mlx.core.array.all": [[30, "mlx-core-array-all"]], "mlx.core.array.any": [[31, "mlx-core-array-any"]], "mlx.core.array.argmax": [[32, "mlx-core-array-argmax"]], "mlx.core.array.argmin": [[33, "mlx-core-array-argmin"]], "mlx.core.array.astype": [[34, "mlx-core-array-astype"]], "mlx.core.array.at": [[35, "mlx-core-array-at"]], "mlx.core.array.cos": [[36, "mlx-core-array-cos"]], "mlx.core.array.cummax": [[37, "mlx-core-array-cummax"]], "mlx.core.array.cummin": [[38, "mlx-core-array-cummin"]], "mlx.core.array.cumprod": [[39, "mlx-core-array-cumprod"]], "mlx.core.array.cumsum": [[40, "mlx-core-array-cumsum"]], "mlx.core.array.diag": [[41, "mlx-core-array-diag"]], "mlx.core.array.diagonal": [[42, "mlx-core-array-diagonal"]], "mlx.core.array.dtype": [[43, "mlx-core-array-dtype"]], "mlx.core.array.exp": [[44, "mlx-core-array-exp"]], "mlx.core.array.flatten": [[45, "mlx-core-array-flatten"]], "mlx.core.array.item": [[46, "mlx-core-array-item"]], "mlx.core.array.itemsize": [[47, "mlx-core-array-itemsize"]], "mlx.core.array.log": [[48, "mlx-core-array-log"]], "mlx.core.array.log10": [[49, "mlx-core-array-log10"]], "mlx.core.array.log1p": [[50, "mlx-core-array-log1p"]], "mlx.core.array.log2": [[51, "mlx-core-array-log2"]], "mlx.core.array.logsumexp": [[52, "mlx-core-array-logsumexp"]], "mlx.core.array.max": [[53, "mlx-core-array-max"]], "mlx.core.array.mean": [[54, "mlx-core-array-mean"]], "mlx.core.array.min": [[55, "mlx-core-array-min"]], "mlx.core.array.moveaxis": [[56, "mlx-core-array-moveaxis"]], "mlx.core.array.nbytes": [[57, "mlx-core-array-nbytes"]], "mlx.core.array.ndim": [[58, "mlx-core-array-ndim"]], "mlx.core.array.prod": [[59, "mlx-core-array-prod"]], "mlx.core.array.reciprocal": [[60, "mlx-core-array-reciprocal"]], "mlx.core.array.reshape": [[61, "mlx-core-array-reshape"]], "mlx.core.array.round": [[62, "mlx-core-array-round"]], "mlx.core.array.rsqrt": [[63, "mlx-core-array-rsqrt"]], "mlx.core.array.shape": [[64, "mlx-core-array-shape"]], "mlx.core.array.sin": [[65, "mlx-core-array-sin"]], "mlx.core.array.size": [[66, "mlx-core-array-size"]], "mlx.core.array.split": [[67, "mlx-core-array-split"]], "mlx.core.array.sqrt": [[68, "mlx-core-array-sqrt"]], "mlx.core.array.square": [[69, "mlx-core-array-square"]], "mlx.core.array.squeeze": [[70, "mlx-core-array-squeeze"]], "mlx.core.array.sum": [[71, "mlx-core-array-sum"]], "mlx.core.array.swapaxes": [[72, "mlx-core-array-swapaxes"]], "mlx.core.array.tolist": [[73, "mlx-core-array-tolist"]], "mlx.core.array.transpose": [[74, "mlx-core-array-transpose"]], "mlx.core.array.var": [[75, "mlx-core-array-var"]], "mlx.core.array_equal": [[76, "mlx-core-array-equal"]], "mlx.core.atleast_1d": [[77, "mlx-core-atleast-1d"]], "mlx.core.atleast_2d": [[78, "mlx-core-atleast-2d"]], "mlx.core.atleast_3d": [[79, "mlx-core-atleast-3d"]], "mlx.core.broadcast_to": [[80, "mlx-core-broadcast-to"]], "mlx.core.ceil": [[81, "mlx-core-ceil"]], "mlx.core.clip": [[82, "mlx-core-clip"]], "mlx.core.compile": [[83, "mlx-core-compile"]], "mlx.core.concatenate": [[84, "mlx-core-concatenate"]], "mlx.core.conv1d": [[85, "mlx-core-conv1d"]], "mlx.core.conv2d": [[86, "mlx-core-conv2d"]], "mlx.core.conv_general": [[87, "mlx-core-conv-general"]], "mlx.core.convolve": [[88, "mlx-core-convolve"]], "mlx.core.cos": [[89, "mlx-core-cos"]], "mlx.core.cosh": [[90, "mlx-core-cosh"]], "mlx.core.cummax": [[91, "mlx-core-cummax"]], "mlx.core.cummin": [[92, "mlx-core-cummin"]], "mlx.core.cumprod": [[93, "mlx-core-cumprod"]], "mlx.core.cumsum": [[94, "mlx-core-cumsum"]], "mlx.core.default_device": [[95, "mlx-core-default-device"]], "mlx.core.default_stream": [[96, "mlx-core-default-stream"]], "mlx.core.dequantize": [[97, "mlx-core-dequantize"]], "mlx.core.diag": [[98, "mlx-core-diag"]], "mlx.core.diagonal": [[99, "mlx-core-diagonal"]], "mlx.core.disable_compile": [[100, "mlx-core-disable-compile"]], "mlx.core.divide": [[101, "mlx-core-divide"]], "mlx.core.divmod": [[102, "mlx-core-divmod"]], "mlx.core.enable_compile": [[103, "mlx-core-enable-compile"]], "mlx.core.equal": [[104, "mlx-core-equal"]], "mlx.core.erf": [[105, "mlx-core-erf"]], "mlx.core.erfinv": [[106, "mlx-core-erfinv"]], "mlx.core.eval": [[107, "mlx-core-eval"]], "mlx.core.exp": [[108, "mlx-core-exp"]], "mlx.core.expand_dims": [[109, "mlx-core-expand-dims"]], "mlx.core.expm1": [[110, "mlx-core-expm1"]], "mlx.core.eye": [[111, "mlx-core-eye"]], "mlx.core.fast.layer_norm": [[112, "mlx-core-fast-layer-norm"]], "mlx.core.fast.rms_norm": [[113, "mlx-core-fast-rms-norm"]], "mlx.core.fast.rope": [[114, "mlx-core-fast-rope"]], "mlx.core.fast.scaled_dot_product_attention": [[115, "mlx-core-fast-scaled-dot-product-attention"]], "mlx.core.fft.fft": [[116, "mlx-core-fft-fft"]], "mlx.core.fft.fft2": [[117, "mlx-core-fft-fft2"]], "mlx.core.fft.fftn": [[118, "mlx-core-fft-fftn"]], "mlx.core.fft.ifft": [[119, "mlx-core-fft-ifft"]], "mlx.core.fft.ifft2": [[120, "mlx-core-fft-ifft2"]], "mlx.core.fft.ifftn": [[121, "mlx-core-fft-ifftn"]], "mlx.core.fft.irfft": [[122, "mlx-core-fft-irfft"]], "mlx.core.fft.irfft2": [[123, "mlx-core-fft-irfft2"]], "mlx.core.fft.irfftn": [[124, "mlx-core-fft-irfftn"]], "mlx.core.fft.rfft": [[125, "mlx-core-fft-rfft"]], "mlx.core.fft.rfft2": [[126, "mlx-core-fft-rfft2"]], "mlx.core.fft.rfftn": [[127, "mlx-core-fft-rfftn"]], "mlx.core.flatten": [[128, "mlx-core-flatten"]], "mlx.core.floor": [[129, "mlx-core-floor"]], "mlx.core.floor_divide": [[130, "mlx-core-floor-divide"]], "mlx.core.full": [[131, "mlx-core-full"]], "mlx.core.grad": [[132, "mlx-core-grad"]], "mlx.core.greater": [[133, "mlx-core-greater"]], "mlx.core.greater_equal": [[134, "mlx-core-greater-equal"]], "mlx.core.identity": [[135, "mlx-core-identity"]], "mlx.core.inner": [[136, "mlx-core-inner"]], "mlx.core.isclose": [[137, "mlx-core-isclose"]], "mlx.core.isinf": [[138, "mlx-core-isinf"]], "mlx.core.isnan": [[139, "mlx-core-isnan"]], "mlx.core.isneginf": [[140, "mlx-core-isneginf"]], "mlx.core.isposinf": [[141, "mlx-core-isposinf"]], "mlx.core.issubdtype": [[142, "mlx-core-issubdtype"]], "mlx.core.jvp": [[143, "mlx-core-jvp"]], "mlx.core.less": [[144, "mlx-core-less"]], "mlx.core.less_equal": [[145, "mlx-core-less-equal"]], "mlx.core.linalg.norm": [[146, "mlx-core-linalg-norm"]], "mlx.core.linalg.qr": [[147, "mlx-core-linalg-qr"]], "mlx.core.linspace": [[148, "mlx-core-linspace"]], "mlx.core.load": [[149, "mlx-core-load"]], "mlx.core.log": [[150, "mlx-core-log"]], "mlx.core.log10": [[151, "mlx-core-log10"]], "mlx.core.log1p": [[152, "mlx-core-log1p"]], "mlx.core.log2": [[153, "mlx-core-log2"]], "mlx.core.logaddexp": [[154, "mlx-core-logaddexp"]], "mlx.core.logical_and": [[155, "mlx-core-logical-and"]], "mlx.core.logical_not": [[156, "mlx-core-logical-not"]], "mlx.core.logical_or": [[157, "mlx-core-logical-or"]], "mlx.core.logsumexp": [[158, "mlx-core-logsumexp"]], "mlx.core.matmul": [[159, "mlx-core-matmul"]], "mlx.core.max": [[160, "mlx-core-max"]], "mlx.core.maximum": [[161, "mlx-core-maximum"]], "mlx.core.mean": [[162, "mlx-core-mean"]], "mlx.core.meshgrid": [[163, "mlx-core-meshgrid"]], "mlx.core.metal.get_active_memory": [[164, "mlx-core-metal-get-active-memory"]], "mlx.core.metal.get_cache_memory": [[165, "mlx-core-metal-get-cache-memory"]], "mlx.core.metal.get_peak_memory": [[166, "mlx-core-metal-get-peak-memory"]], "mlx.core.metal.is_available": [[167, "mlx-core-metal-is-available"]], "mlx.core.metal.set_cache_limit": [[168, "mlx-core-metal-set-cache-limit"]], "mlx.core.metal.set_memory_limit": [[169, "mlx-core-metal-set-memory-limit"]], "mlx.core.metal.start_capture": [[170, "mlx-core-metal-start-capture"]], "mlx.core.metal.stop_capture": [[171, "mlx-core-metal-stop-capture"]], "mlx.core.min": [[172, "mlx-core-min"]], "mlx.core.minimum": [[173, "mlx-core-minimum"]], "mlx.core.moveaxis": [[174, "mlx-core-moveaxis"]], "mlx.core.multiply": [[175, "mlx-core-multiply"]], "mlx.core.negative": [[176, "mlx-core-negative"]], "mlx.core.new_stream": [[177, "mlx-core-new-stream"]], "mlx.core.ones": [[178, "mlx-core-ones"]], "mlx.core.ones_like": [[179, "mlx-core-ones-like"]], "mlx.core.outer": [[180, "mlx-core-outer"]], "mlx.core.pad": [[181, "mlx-core-pad"]], "mlx.core.partition": [[182, "mlx-core-partition"]], "mlx.core.prod": [[183, "mlx-core-prod"]], "mlx.core.quantize": [[184, "mlx-core-quantize"]], "mlx.core.quantized_matmul": [[185, "mlx-core-quantized-matmul"]], "mlx.core.random.bernoulli": [[186, "mlx-core-random-bernoulli"]], "mlx.core.random.categorical": [[187, "mlx-core-random-categorical"]], "mlx.core.random.gumbel": [[188, "mlx-core-random-gumbel"]], "mlx.core.random.key": [[189, "mlx-core-random-key"]], "mlx.core.random.multivariate_normal": [[190, "mlx-core-random-multivariate-normal"]], "mlx.core.random.normal": [[191, "mlx-core-random-normal"]], "mlx.core.random.randint": [[192, "mlx-core-random-randint"]], "mlx.core.random.seed": [[193, "mlx-core-random-seed"]], "mlx.core.random.split": [[194, "mlx-core-random-split"]], "mlx.core.random.truncated_normal": [[195, "mlx-core-random-truncated-normal"]], "mlx.core.random.uniform": [[196, "mlx-core-random-uniform"]], "mlx.core.reciprocal": [[197, "mlx-core-reciprocal"]], "mlx.core.repeat": [[198, "mlx-core-repeat"]], "mlx.core.reshape": [[199, "mlx-core-reshape"]], "mlx.core.round": [[200, "mlx-core-round"]], "mlx.core.rsqrt": [[201, "mlx-core-rsqrt"]], "mlx.core.save": [[202, "mlx-core-save"]], "mlx.core.save_gguf": [[203, "mlx-core-save-gguf"]], "mlx.core.save_safetensors": [[204, "mlx-core-save-safetensors"]], "mlx.core.savez": [[205, "mlx-core-savez"]], "mlx.core.savez_compressed": [[206, "mlx-core-savez-compressed"]], "mlx.core.set_default_device": [[207, "mlx-core-set-default-device"]], "mlx.core.set_default_stream": [[208, "mlx-core-set-default-stream"]], "mlx.core.sigmoid": [[209, "mlx-core-sigmoid"]], "mlx.core.sign": [[210, "mlx-core-sign"]], "mlx.core.sin": [[211, "mlx-core-sin"]], "mlx.core.sinh": [[212, "mlx-core-sinh"]], "mlx.core.softmax": [[213, "mlx-core-softmax"]], "mlx.core.sort": [[214, "mlx-core-sort"]], "mlx.core.split": [[215, "mlx-core-split"]], "mlx.core.sqrt": [[216, "mlx-core-sqrt"]], "mlx.core.square": [[217, "mlx-core-square"]], "mlx.core.squeeze": [[218, "mlx-core-squeeze"]], "mlx.core.stack": [[219, "mlx-core-stack"]], "mlx.core.std": [[220, "mlx-core-std"]], "mlx.core.stop_gradient": [[221, "mlx-core-stop-gradient"]], "mlx.core.stream": [[222, "mlx-core-stream"]], "mlx.core.subtract": [[223, "mlx-core-subtract"]], "mlx.core.sum": [[224, "mlx-core-sum"]], "mlx.core.swapaxes": [[225, "mlx-core-swapaxes"]], "mlx.core.take": [[226, "mlx-core-take"]], "mlx.core.take_along_axis": [[227, "mlx-core-take-along-axis"]], "mlx.core.tan": [[228, "mlx-core-tan"]], "mlx.core.tanh": [[229, "mlx-core-tanh"]], "mlx.core.tensordot": [[230, "mlx-core-tensordot"]], "mlx.core.tile": [[231, "mlx-core-tile"]], "mlx.core.topk": [[232, "mlx-core-topk"]], "mlx.core.transpose": [[233, "mlx-core-transpose"]], "mlx.core.tri": [[234, "mlx-core-tri"]], "mlx.core.tril": [[235, "mlx-core-tril"]], "mlx.core.triu": [[236, "mlx-core-triu"]], "mlx.core.value_and_grad": [[237, "mlx-core-value-and-grad"]], "mlx.core.var": [[238, "mlx-core-var"]], "mlx.core.vjp": [[239, "mlx-core-vjp"]], "mlx.core.vmap": [[240, "mlx-core-vmap"]], "mlx.core.where": [[241, "mlx-core-where"]], "mlx.core.zeros": [[242, "mlx-core-zeros"]], "mlx.core.zeros_like": [[243, "mlx-core-zeros-like"]], "mlx.nn.value_and_grad": [[244, "mlx-nn-value-and-grad"]], "mlx.utils.tree_flatten": [[245, "mlx-utils-tree-flatten"]], "mlx.utils.tree_map": [[246, "mlx-utils-tree-map"]], "mlx.utils.tree_unflatten": [[247, "mlx-utils-tree-unflatten"]], "mlx.core.Stream": [[248, "mlx-core-stream"]], "Array": [[249, "array"]], "Data Types": [[250, "data-types"]], "Supported Data Types": [[250, "id2"]], "Devices and Streams": [[251, "devices-and-streams"]], "Fast": [[252, "fast"]], "FFT": [[253, "fft"]], "Linear Algebra": [[254, "linear-algebra"]], "Metal": [[255, "metal"]], "Neural Networks": [[256, "neural-networks"]], "Quick Start with Neural Networks": [[256, "quick-start-with-neural-networks"]], "The Module Class": [[256, "the-module-class"]], "Parameters": [[256, "parameters"]], "Updating the Parameters": [[256, "updating-the-parameters"]], "Inspecting Modules": [[256, "inspecting-modules"]], "Value and Grad": [[256, "value-and-grad"]], "mlx.nn.ALiBi": [[257, "mlx-nn-alibi"]], "mlx.nn.AvgPool1d": [[258, "mlx-nn-avgpool1d"]], "mlx.nn.AvgPool2d": [[259, "mlx-nn-avgpool2d"]], "mlx.nn.BatchNorm": [[260, "mlx-nn-batchnorm"]], "mlx.nn.Conv1d": [[261, "mlx-nn-conv1d"]], "mlx.nn.Conv2d": [[262, "mlx-nn-conv2d"]], "mlx.nn.Dropout": [[263, "mlx-nn-dropout"]], "mlx.nn.Dropout2d": [[264, "mlx-nn-dropout2d"]], "mlx.nn.Dropout3d": [[265, "mlx-nn-dropout3d"]], "mlx.nn.Embedding": [[266, "mlx-nn-embedding"]], "mlx.nn.GELU": [[267, "mlx-nn-gelu"]], "mlx.nn.GRU": [[268, "mlx-nn-gru"]], "mlx.nn.GroupNorm": [[269, "mlx-nn-groupnorm"]], "mlx.nn.InstanceNorm": [[270, "mlx-nn-instancenorm"]], "mlx.nn.LSTM": [[271, "mlx-nn-lstm"]], "mlx.nn.LayerNorm": [[272, "mlx-nn-layernorm"]], "mlx.nn.Linear": [[273, "mlx-nn-linear"]], "mlx.nn.MaxPool1d": [[274, "mlx-nn-maxpool1d"]], "mlx.nn.MaxPool2d": [[275, "mlx-nn-maxpool2d"]], "mlx.nn.Mish": [[276, "mlx-nn-mish"]], "mlx.nn.Module.apply": [[277, "mlx-nn-module-apply"]], "mlx.nn.Module.apply_to_modules": [[278, "mlx-nn-module-apply-to-modules"]], "mlx.nn.Module.children": [[279, "mlx-nn-module-children"]], "mlx.nn.Module.eval": [[280, "mlx-nn-module-eval"]], "mlx.nn.Module.filter_and_map": [[281, "mlx-nn-module-filter-and-map"]], "mlx.nn.Module.freeze": [[282, "mlx-nn-module-freeze"]], "mlx.nn.Module.leaf_modules": [[283, "mlx-nn-module-leaf-modules"]], "mlx.nn.Module.load_weights": [[284, "mlx-nn-module-load-weights"]], "mlx.nn.Module.modules": [[285, "mlx-nn-module-modules"]], "mlx.nn.Module.named_modules": [[286, "mlx-nn-module-named-modules"]], "mlx.nn.Module.parameters": [[287, "mlx-nn-module-parameters"]], "mlx.nn.Module.save_weights": [[288, "mlx-nn-module-save-weights"]], "mlx.nn.Module.set_dtype": [[289, "mlx-nn-module-set-dtype"]], "mlx.nn.Module.state": [[290, "mlx-nn-module-state"]], "mlx.nn.Module.train": [[291, "mlx-nn-module-train"]], "mlx.nn.Module.trainable_parameters": [[292, "mlx-nn-module-trainable-parameters"]], "mlx.nn.Module.training": [[293, "mlx-nn-module-training"]], "mlx.nn.Module.unfreeze": [[294, "mlx-nn-module-unfreeze"]], "mlx.nn.Module.update": [[295, "mlx-nn-module-update"]], "mlx.nn.Module.update_modules": [[296, "mlx-nn-module-update-modules"]], "mlx.nn.MultiHeadAttention": [[297, "mlx-nn-multiheadattention"]], "mlx.nn.PReLU": [[298, "mlx-nn-prelu"]], "mlx.nn.QuantizedLinear": [[299, "mlx-nn-quantizedlinear"]], "mlx.nn.RMSNorm": [[300, "mlx-nn-rmsnorm"]], "mlx.nn.RNN": [[301, "mlx-nn-rnn"]], "mlx.nn.ReLU": [[302, "mlx-nn-relu"]], "mlx.nn.RoPE": [[303, "mlx-nn-rope"]], "mlx.nn.SELU": [[304, "mlx-nn-selu"]], "mlx.nn.Sequential": [[305, "mlx-nn-sequential"]], "mlx.nn.SiLU": [[306, "mlx-nn-silu"]], "mlx.nn.SinusoidalPositionalEncoding": [[307, "mlx-nn-sinusoidalpositionalencoding"]], "mlx.nn.Softshrink": [[308, "mlx-nn-softshrink"]], "mlx.nn.Step": [[309, "mlx-nn-step"]], "mlx.nn.Transformer": [[310, "mlx-nn-transformer"]], "mlx.nn.Upsample": [[311, "mlx-nn-upsample"]], "mlx.nn.init.constant": [[312, "mlx-nn-init-constant"]], "mlx.nn.init.glorot_normal": [[313, "mlx-nn-init-glorot-normal"]], "mlx.nn.init.glorot_uniform": [[314, "mlx-nn-init-glorot-uniform"]], "mlx.nn.init.he_normal": [[315, "mlx-nn-init-he-normal"]], "mlx.nn.init.he_uniform": [[316, "mlx-nn-init-he-uniform"]], "mlx.nn.init.identity": [[317, "mlx-nn-init-identity"]], "mlx.nn.init.normal": [[318, "mlx-nn-init-normal"]], "mlx.nn.init.uniform": [[319, "mlx-nn-init-uniform"]], "mlx.nn.elu": [[320, "mlx-nn-elu"]], "mlx.nn.gelu": [[321, "mlx-nn-gelu"]], "mlx.nn.gelu_approx": [[322, "mlx-nn-gelu-approx"]], "mlx.nn.gelu_fast_approx": [[323, "mlx-nn-gelu-fast-approx"]], "mlx.nn.glu": [[324, "mlx-nn-glu"]], "mlx.nn.hardswish": [[325, "mlx-nn-hardswish"]], "mlx.nn.leaky_relu": [[326, "mlx-nn-leaky-relu"]], "mlx.nn.log_sigmoid": [[327, "mlx-nn-log-sigmoid"]], "mlx.nn.log_softmax": [[328, "mlx-nn-log-softmax"]], "mlx.nn.losses.binary_cross_entropy": [[329, "mlx-nn-losses-binary-cross-entropy"]], "mlx.nn.losses.cosine_similarity_loss": [[330, "mlx-nn-losses-cosine-similarity-loss"]], "mlx.nn.losses.cross_entropy": [[331, "mlx-nn-losses-cross-entropy"]], "mlx.nn.losses.gaussian_nll_loss": [[332, "mlx-nn-losses-gaussian-nll-loss"]], "mlx.nn.losses.hinge_loss": [[333, "mlx-nn-losses-hinge-loss"]], "mlx.nn.losses.huber_loss": [[334, "mlx-nn-losses-huber-loss"]], "mlx.nn.losses.kl_div_loss": [[335, "mlx-nn-losses-kl-div-loss"]], "mlx.nn.losses.l1_loss": [[336, "mlx-nn-losses-l1-loss"]], "mlx.nn.losses.log_cosh_loss": [[337, "mlx-nn-losses-log-cosh-loss"]], "mlx.nn.losses.margin_ranking_loss": [[338, "mlx-nn-losses-margin-ranking-loss"]], "mlx.nn.losses.mse_loss": [[339, "mlx-nn-losses-mse-loss"]], "mlx.nn.losses.nll_loss": [[340, "mlx-nn-losses-nll-loss"]], "mlx.nn.losses.smooth_l1_loss": [[341, "mlx-nn-losses-smooth-l1-loss"]], "mlx.nn.losses.triplet_loss": [[342, "mlx-nn-losses-triplet-loss"]], "mlx.nn.mish": [[343, "mlx-nn-mish"]], "mlx.nn.prelu": [[344, "mlx-nn-prelu"]], "mlx.nn.relu": [[345, "mlx-nn-relu"]], "mlx.nn.relu6": [[346, "mlx-nn-relu6"]], "mlx.nn.selu": [[347, "mlx-nn-selu"]], "mlx.nn.sigmoid": [[348, "mlx-nn-sigmoid"]], "mlx.nn.silu": [[349, "mlx-nn-silu"]], "mlx.nn.softmax": [[350, "mlx-nn-softmax"]], "mlx.nn.softplus": [[351, "mlx-nn-softplus"]], "mlx.nn.softshrink": [[352, "mlx-nn-softshrink"]], "mlx.nn.step": [[353, "mlx-nn-step"]], "mlx.nn.tanh": [[354, "mlx-nn-tanh"]], "Functions": [[355, "functions"]], "Initializers": [[356, "initializers"]], "Layers": [[357, "layers"]], "Loss Functions": [[358, "loss-functions"]], "Module": [[359, "module"]], "Optimizers": [[361, "optimizers"]], "mlx.optimizers.AdaDelta": [[362, "mlx-optimizers-adadelta"]], "mlx.optimizers.Adafactor": [[363, "mlx-optimizers-adafactor"]], "mlx.optimizers.Adagrad": [[364, "mlx-optimizers-adagrad"]], "mlx.optimizers.Adam": [[365, "mlx-optimizers-adam"]], "mlx.optimizers.AdamW": [[366, "mlx-optimizers-adamw"]], "mlx.optimizers.Adamax": [[367, "mlx-optimizers-adamax"]], "mlx.optimizers.Lion": [[368, "mlx-optimizers-lion"]], "mlx.optimizers.Optimizer.apply_gradients": [[369, "mlx-optimizers-optimizer-apply-gradients"]], "mlx.optimizers.Optimizer.init": [[370, "mlx-optimizers-optimizer-init"]], "mlx.optimizers.Optimizer.state": [[371, "mlx-optimizers-optimizer-state"]], "mlx.optimizers.Optimizer.update": [[372, "mlx-optimizers-optimizer-update"]], "mlx.optimizers.RMSprop": [[373, "mlx-optimizers-rmsprop"]], "mlx.optimizers.SGD": [[374, "mlx-optimizers-sgd"]], "mlx.optimizers.cosine_decay": [[375, "mlx-optimizers-cosine-decay"]], "mlx.optimizers.exponential_decay": [[376, "mlx-optimizers-exponential-decay"]], "mlx.optimizers.join_schedules": [[377, "mlx-optimizers-join-schedules"]], "mlx.optimizers.linear_schedule": [[378, "mlx-optimizers-linear-schedule"]], "mlx.optimizers.step_decay": [[379, "mlx-optimizers-step-decay"]], "Common Optimizers": [[380, "common-optimizers"]], "Optimizer": [[381, "optimizer"]], "Schedulers": [[382, "schedulers"]], "Random": [[383, "random"]], "Transforms": [[384, "transforms"]], "Tree Utils": [[385, "tree-utils"]], "Compilation": [[386, "compilation"]], "Basics of Compile": [[386, "basics-of-compile"]], "Example Speedup": [[386, "example-speedup"]], "Debugging": [[386, "debugging"]], "Pure Functions": [[386, "pure-functions"]], "Compiling Training Graphs": [[386, "compiling-training-graphs"]], "Transformations with Compile": [[386, "transformations-with-compile"]], "Function Transforms": [[387, "function-transforms"]], "Automatic Differentiation": [[387, "automatic-differentiation"]], "Automatic Vectorization": [[387, "automatic-vectorization"]], "Indexing Arrays": [[388, "indexing-arrays"]], "Differences from NumPy": [[388, "differences-from-numpy"]], "In Place Updates": [[388, "in-place-updates"]], "Lazy Evaluation": [[389, "lazy-evaluation"]], "Why Lazy Evaluation": [[389, "why-lazy-evaluation"]], "Transforming Compute Graphs": [[389, "transforming-compute-graphs"]], "Only Compute What You Use": [[389, "only-compute-what-you-use"]], "When to Evaluate": [[389, "when-to-evaluate"]], "Conversion to NumPy and Other Frameworks": [[390, "conversion-to-numpy-and-other-frameworks"]], "PyTorch": [[390, "pytorch"]], "JAX": [[390, "jax"]], "TensorFlow": [[390, "tensorflow"]], "Quick Start Guide": [[391, "quick-start-guide"]], "Basics": [[391, "basics"]], "Function and Graph Transformations": [[391, "function-and-graph-transformations"]], "Saving and Loading Arrays": [[392, "saving-and-loading-arrays"]], "Serialization Formats": [[392, "id1"]], "Unified Memory": [[393, "unified-memory"]], "A Simple Example": [[393, "a-simple-example"]], "Using Streams": [[394, "using-streams"]], "Specifying the Stream": [[394, "specifying-the-stream"]]}, "indexentries": {"device (class in mlx.core)": [[8, "mlx.core.Device"]], "__init__() (device method)": [[8, "mlx.core.Device.__init__"]], "dtype (class in mlx.core)": [[9, "mlx.core.Dtype"]], "__init__() (dtype method)": [[9, "mlx.core.Dtype.__init__"]], "dtypecategory (class in mlx.core)": [[10, "mlx.core.DtypeCategory"]], "__init__() (dtypecategory method)": [[10, "mlx.core.DtypeCategory.__init__"]], "abs() (in module mlx.core)": [[11, "mlx.core.abs"]], "add() (in module mlx.core)": [[12, "mlx.core.add"]], "all() (in module mlx.core)": [[13, "mlx.core.all"]], "allclose() (in module mlx.core)": [[14, "mlx.core.allclose"]], "any() (in module mlx.core)": [[15, "mlx.core.any"]], "arange() (in module mlx.core)": [[16, "mlx.core.arange"]], "arccos() (in module mlx.core)": [[17, "mlx.core.arccos"]], "arccosh() (in module mlx.core)": [[18, "mlx.core.arccosh"]], "arcsin() (in module mlx.core)": [[19, "mlx.core.arcsin"]], "arcsinh() (in module mlx.core)": [[20, "mlx.core.arcsinh"]], "arctan() (in module mlx.core)": [[21, "mlx.core.arctan"]], "arctanh() (in module mlx.core)": [[22, "mlx.core.arctanh"]], "argmax() (in module mlx.core)": [[23, "mlx.core.argmax"]], "argmin() (in module mlx.core)": [[24, "mlx.core.argmin"]], "argpartition() (in module mlx.core)": [[25, "mlx.core.argpartition"]], "argsort() (in module mlx.core)": [[26, "mlx.core.argsort"]], "__init__() (array method)": [[27, "mlx.core.array.__init__"]], "array (class in mlx.core)": [[27, "mlx.core.array"]], "t (array property)": [[28, "mlx.core.array.T"]], "abs() (array method)": [[29, "mlx.core.array.abs"]], "all() (array method)": [[30, "mlx.core.array.all"]], "any() (array method)": [[31, "mlx.core.array.any"]], "argmax() (array method)": [[32, "mlx.core.array.argmax"]], "argmin() (array method)": [[33, "mlx.core.array.argmin"]], "astype() (array method)": [[34, "mlx.core.array.astype"]], "at (array property)": [[35, "mlx.core.array.at"]], "cos() (array method)": [[36, "mlx.core.array.cos"]], "cummax() (array method)": [[37, "mlx.core.array.cummax"]], "cummin() (array method)": [[38, "mlx.core.array.cummin"]], "cumprod() (array method)": [[39, "mlx.core.array.cumprod"]], "cumsum() (array method)": [[40, "mlx.core.array.cumsum"]], "diag() (array method)": [[41, "mlx.core.array.diag"]], "diagonal() (array method)": [[42, "mlx.core.array.diagonal"]], "dtype (array property)": [[43, "mlx.core.array.dtype"]], "exp() (array method)": [[44, "mlx.core.array.exp"]], "flatten() (array method)": [[45, "mlx.core.array.flatten"]], "item() (array method)": [[46, "mlx.core.array.item"]], "itemsize (array property)": [[47, "mlx.core.array.itemsize"]], "log() (array method)": [[48, "mlx.core.array.log"]], "log10() (array method)": [[49, "mlx.core.array.log10"]], "log1p() (array method)": [[50, "mlx.core.array.log1p"]], "log2() (array method)": [[51, "mlx.core.array.log2"]], "logsumexp() (array method)": [[52, "mlx.core.array.logsumexp"]], "max() (array method)": [[53, "mlx.core.array.max"]], "mean() (array method)": [[54, "mlx.core.array.mean"]], "min() (array method)": [[55, "mlx.core.array.min"]], "moveaxis() (array method)": [[56, "mlx.core.array.moveaxis"]], "nbytes (array property)": [[57, "mlx.core.array.nbytes"]], "ndim (array property)": [[58, "mlx.core.array.ndim"]], "prod() (array method)": [[59, "mlx.core.array.prod"]], "reciprocal() (array method)": [[60, "mlx.core.array.reciprocal"]], "reshape() (array method)": [[61, "mlx.core.array.reshape"]], "round() (array method)": [[62, "mlx.core.array.round"]], "rsqrt() (array method)": [[63, "mlx.core.array.rsqrt"]], "shape (array property)": [[64, "mlx.core.array.shape"]], "sin() (array method)": [[65, "mlx.core.array.sin"]], "size (array property)": [[66, "mlx.core.array.size"]], "split() (array method)": [[67, "mlx.core.array.split"]], "sqrt() (array method)": [[68, "mlx.core.array.sqrt"]], "square() (array method)": [[69, "mlx.core.array.square"]], "squeeze() (array method)": [[70, "mlx.core.array.squeeze"]], "sum() (array method)": [[71, "mlx.core.array.sum"]], "swapaxes() (array method)": [[72, "mlx.core.array.swapaxes"]], "tolist() (array method)": [[73, "mlx.core.array.tolist"]], "transpose() (array method)": [[74, "mlx.core.array.transpose"]], "var() (array method)": [[75, "mlx.core.array.var"]], "array_equal() (in module mlx.core)": [[76, "mlx.core.array_equal"]], "atleast_1d() (in module mlx.core)": [[77, "mlx.core.atleast_1d"]], "atleast_2d() (in module mlx.core)": [[78, "mlx.core.atleast_2d"]], "atleast_3d() (in module mlx.core)": [[79, "mlx.core.atleast_3d"]], "broadcast_to() (in module mlx.core)": [[80, "mlx.core.broadcast_to"]], "ceil() (in module mlx.core)": [[81, "mlx.core.ceil"]], "clip() (in module mlx.core)": [[82, "mlx.core.clip"]], "compile() (in module mlx.core)": [[83, "mlx.core.compile"]], "concatenate() (in module mlx.core)": [[84, "mlx.core.concatenate"]], "conv1d() (in module mlx.core)": [[85, "mlx.core.conv1d"]], "conv2d() (in module mlx.core)": [[86, "mlx.core.conv2d"]], "conv_general() (in module mlx.core)": [[87, "mlx.core.conv_general"]], "convolve() (in module mlx.core)": [[88, "mlx.core.convolve"]], "cos() (in module mlx.core)": [[89, "mlx.core.cos"]], "cosh() (in module mlx.core)": [[90, "mlx.core.cosh"]], "cummax() (in module mlx.core)": [[91, "mlx.core.cummax"]], "cummin() (in module mlx.core)": [[92, "mlx.core.cummin"]], "cumprod() (in module mlx.core)": [[93, "mlx.core.cumprod"]], "cumsum() (in module mlx.core)": [[94, "mlx.core.cumsum"]], "default_device() (in module mlx.core)": [[95, "mlx.core.default_device"]], "default_stream() (in module mlx.core)": [[96, "mlx.core.default_stream"]], "dequantize() (in module mlx.core)": [[97, "mlx.core.dequantize"]], "diag() (in module mlx.core)": [[98, "mlx.core.diag"]], "diagonal() (in module mlx.core)": [[99, "mlx.core.diagonal"]], "disable_compile() (in module mlx.core)": [[100, "mlx.core.disable_compile"]], "divide() (in module mlx.core)": [[101, "mlx.core.divide"]], "divmod() (in module mlx.core)": [[102, "mlx.core.divmod"]], "enable_compile() (in module mlx.core)": [[103, "mlx.core.enable_compile"]], "equal() (in module mlx.core)": [[104, "mlx.core.equal"]], "erf() (in module mlx.core)": [[105, "mlx.core.erf"]], "erfinv() (in module mlx.core)": [[106, "mlx.core.erfinv"]], "eval() (in module mlx.core)": [[107, "mlx.core.eval"]], "exp() (in module mlx.core)": [[108, "mlx.core.exp"]], "expand_dims() (in module mlx.core)": [[109, "mlx.core.expand_dims"]], "expm1() (in module mlx.core)": [[110, "mlx.core.expm1"]], "eye() (in module mlx.core)": [[111, "mlx.core.eye"]], "layer_norm() (in module mlx.core.fast)": [[112, "mlx.core.fast.layer_norm"]], "rms_norm() (in module mlx.core.fast)": [[113, "mlx.core.fast.rms_norm"]], "rope() (in module mlx.core.fast)": [[114, "mlx.core.fast.rope"]], "scaled_dot_product_attention() (in module mlx.core.fast)": [[115, "mlx.core.fast.scaled_dot_product_attention"]], "fft() (in module mlx.core.fft)": [[116, "mlx.core.fft.fft"]], "fft2() (in module mlx.core.fft)": [[117, "mlx.core.fft.fft2"]], "fftn() (in module mlx.core.fft)": [[118, "mlx.core.fft.fftn"]], "ifft() (in module mlx.core.fft)": [[119, "mlx.core.fft.ifft"]], "ifft2() (in module mlx.core.fft)": [[120, "mlx.core.fft.ifft2"]], "ifftn() (in module mlx.core.fft)": [[121, "mlx.core.fft.ifftn"]], "irfft() (in module mlx.core.fft)": [[122, "mlx.core.fft.irfft"]], "irfft2() (in module mlx.core.fft)": [[123, "mlx.core.fft.irfft2"]], "irfftn() (in module mlx.core.fft)": [[124, "mlx.core.fft.irfftn"]], "rfft() (in module mlx.core.fft)": [[125, "mlx.core.fft.rfft"]], "rfft2() (in module mlx.core.fft)": [[126, "mlx.core.fft.rfft2"]], "rfftn() (in module mlx.core.fft)": [[127, "mlx.core.fft.rfftn"]], "flatten() (in module mlx.core)": [[128, "mlx.core.flatten"]], "floor() (in module mlx.core)": [[129, "mlx.core.floor"]], "floor_divide() (in module mlx.core)": [[130, "mlx.core.floor_divide"]], "full() (in module mlx.core)": [[131, "mlx.core.full"]], "grad() (in module mlx.core)": [[132, "mlx.core.grad"]], "greater() (in module mlx.core)": [[133, "mlx.core.greater"]], "greater_equal() (in module mlx.core)": [[134, "mlx.core.greater_equal"]], "identity() (in module mlx.core)": [[135, "mlx.core.identity"]], "inner() (in module mlx.core)": [[136, "mlx.core.inner"]], "isclose() (in module mlx.core)": [[137, "mlx.core.isclose"]], "isinf() (in module mlx.core)": [[138, "mlx.core.isinf"]], "isnan() (in module mlx.core)": [[139, "mlx.core.isnan"]], "isneginf() (in module mlx.core)": [[140, "mlx.core.isneginf"]], "isposinf() (in module mlx.core)": [[141, "mlx.core.isposinf"]], "issubdtype() (in module mlx.core)": [[142, "mlx.core.issubdtype"]], "jvp() (in module mlx.core)": [[143, "mlx.core.jvp"]], "less() (in module mlx.core)": [[144, "mlx.core.less"]], "less_equal() (in module mlx.core)": [[145, "mlx.core.less_equal"]], "norm() (in module mlx.core.linalg)": [[146, "mlx.core.linalg.norm"]], "qr() (in module mlx.core.linalg)": [[147, "mlx.core.linalg.qr"]], "linspace() (in module mlx.core)": [[148, "mlx.core.linspace"]], "load() (in module mlx.core)": [[149, "mlx.core.load"]], "log() (in module mlx.core)": [[150, "mlx.core.log"]], "log10() (in module mlx.core)": [[151, "mlx.core.log10"]], "log1p() (in module mlx.core)": [[152, "mlx.core.log1p"]], "log2() (in module mlx.core)": [[153, "mlx.core.log2"]], "logaddexp() (in module mlx.core)": [[154, "mlx.core.logaddexp"]], "logical_and() (in module mlx.core)": [[155, "mlx.core.logical_and"]], "logical_not() (in module mlx.core)": [[156, "mlx.core.logical_not"]], "logical_or() (in module mlx.core)": [[157, "mlx.core.logical_or"]], "logsumexp() (in module mlx.core)": [[158, "mlx.core.logsumexp"]], "matmul() (in module mlx.core)": [[159, "mlx.core.matmul"]], "max() (in module mlx.core)": [[160, "mlx.core.max"]], "maximum() (in module mlx.core)": [[161, "mlx.core.maximum"]], "mean() (in module mlx.core)": [[162, "mlx.core.mean"]], "meshgrid() (in module mlx.core)": [[163, "mlx.core.meshgrid"]], "get_active_memory() (in module mlx.core.metal)": [[164, "mlx.core.metal.get_active_memory"]], "get_cache_memory() (in module mlx.core.metal)": [[165, "mlx.core.metal.get_cache_memory"]], "get_peak_memory() (in module mlx.core.metal)": [[166, "mlx.core.metal.get_peak_memory"]], "is_available() (in module mlx.core.metal)": [[167, "mlx.core.metal.is_available"]], "set_cache_limit() (in module mlx.core.metal)": [[168, "mlx.core.metal.set_cache_limit"]], "set_memory_limit() (in module mlx.core.metal)": [[169, "mlx.core.metal.set_memory_limit"]], "start_capture() (in module mlx.core.metal)": [[170, "mlx.core.metal.start_capture"]], "stop_capture() (in module mlx.core.metal)": [[171, "mlx.core.metal.stop_capture"]], "min() (in module mlx.core)": [[172, "mlx.core.min"]], "minimum() (in module mlx.core)": [[173, "mlx.core.minimum"]], "moveaxis() (in module mlx.core)": [[174, "mlx.core.moveaxis"]], "multiply() (in module mlx.core)": [[175, "mlx.core.multiply"]], "negative() (in module mlx.core)": [[176, "mlx.core.negative"]], "new_stream() (in module mlx.core)": [[177, "mlx.core.new_stream"]], "ones() (in module mlx.core)": [[178, "mlx.core.ones"]], "ones_like() (in module mlx.core)": [[179, "mlx.core.ones_like"]], "outer() (in module mlx.core)": [[180, "mlx.core.outer"]], "pad() (in module mlx.core)": [[181, "mlx.core.pad"]], "partition() (in module mlx.core)": [[182, "mlx.core.partition"]], "prod() (in module mlx.core)": [[183, "mlx.core.prod"]], "quantize() (in module mlx.core)": [[184, "mlx.core.quantize"]], "quantized_matmul() (in module mlx.core)": [[185, "mlx.core.quantized_matmul"]], "bernoulli() (in module mlx.core.random)": [[186, "mlx.core.random.bernoulli"]], "categorical() (in module mlx.core.random)": [[187, "mlx.core.random.categorical"]], "gumbel() (in module mlx.core.random)": [[188, "mlx.core.random.gumbel"]], "key() (in module mlx.core.random)": [[189, "mlx.core.random.key"]], "multivariate_normal() (in module mlx.core.random)": [[190, "mlx.core.random.multivariate_normal"]], "normal() (in module mlx.core.random)": [[191, "mlx.core.random.normal"]], "randint() (in module mlx.core.random)": [[192, "mlx.core.random.randint"]], "seed() (in module mlx.core.random)": [[193, "mlx.core.random.seed"]], "split() (in module mlx.core.random)": [[194, "mlx.core.random.split"]], "truncated_normal() (in module mlx.core.random)": [[195, "mlx.core.random.truncated_normal"]], "uniform() (in module mlx.core.random)": [[196, "mlx.core.random.uniform"]], "reciprocal() (in module mlx.core)": [[197, "mlx.core.reciprocal"]], "repeat() (in module mlx.core)": [[198, "mlx.core.repeat"]], "reshape() (in module mlx.core)": [[199, "mlx.core.reshape"]], "round() (in module mlx.core)": [[200, "mlx.core.round"]], "rsqrt() (in module mlx.core)": [[201, "mlx.core.rsqrt"]], "save() (in module mlx.core)": [[202, "mlx.core.save"]], "save_gguf() (in module mlx.core)": [[203, "mlx.core.save_gguf"]], "save_safetensors() (in module mlx.core)": [[204, "mlx.core.save_safetensors"]], "savez() (in module mlx.core)": [[205, "mlx.core.savez"]], "savez_compressed() (in module mlx.core)": [[206, "mlx.core.savez_compressed"]], "set_default_device() (in module mlx.core)": [[207, "mlx.core.set_default_device"]], "set_default_stream() (in module mlx.core)": [[208, "mlx.core.set_default_stream"]], "sigmoid() (in module mlx.core)": [[209, "mlx.core.sigmoid"]], "sign() (in module mlx.core)": [[210, "mlx.core.sign"]], "sin() (in module mlx.core)": [[211, "mlx.core.sin"]], "sinh() (in module mlx.core)": [[212, "mlx.core.sinh"]], "softmax() (in module mlx.core)": [[213, "mlx.core.softmax"]], "sort() (in module mlx.core)": [[214, "mlx.core.sort"]], "split() (in module mlx.core)": [[215, "mlx.core.split"]], "sqrt() (in module mlx.core)": [[216, "mlx.core.sqrt"]], "square() (in module mlx.core)": [[217, "mlx.core.square"]], "squeeze() (in module mlx.core)": [[218, "mlx.core.squeeze"]], "stack() (in module mlx.core)": [[219, "mlx.core.stack"]], "std() (in module mlx.core)": [[220, "mlx.core.std"]], "stop_gradient() (in module mlx.core)": [[221, "mlx.core.stop_gradient"]], "stream() (in module mlx.core)": [[222, "mlx.core.stream"]], "subtract() (in module mlx.core)": [[223, "mlx.core.subtract"]], "sum() (in module mlx.core)": [[224, "mlx.core.sum"]], "swapaxes() (in module mlx.core)": [[225, "mlx.core.swapaxes"]], "take() (in module mlx.core)": [[226, "mlx.core.take"]], "take_along_axis() (in module mlx.core)": [[227, "mlx.core.take_along_axis"]], "tan() (in module mlx.core)": [[228, "mlx.core.tan"]], "tanh() (in module mlx.core)": [[229, "mlx.core.tanh"]], "tensordot() (in module mlx.core)": [[230, "mlx.core.tensordot"]], "tile() (in module mlx.core)": [[231, "mlx.core.tile"]], "topk() (in module mlx.core)": [[232, "mlx.core.topk"]], "transpose() (in module mlx.core)": [[233, "mlx.core.transpose"]], "tri() (in module mlx.core)": [[234, "mlx.core.tri"]], "tril() (in module mlx.core)": [[235, "mlx.core.tril"]], "triu() (in module mlx.core)": [[236, "mlx.core.triu"]], "value_and_grad() (in module mlx.core)": [[237, "mlx.core.value_and_grad"]], "var() (in module mlx.core)": [[238, "mlx.core.var"]], "vjp() (in module mlx.core)": [[239, "mlx.core.vjp"]], "vmap() (in module mlx.core)": [[240, "mlx.core.vmap"]], "where() (in module mlx.core)": [[241, "mlx.core.where"]], "zeros() (in module mlx.core)": [[242, "mlx.core.zeros"]], "zeros_like() (in module mlx.core)": [[243, "mlx.core.zeros_like"]], "value_and_grad() (in module mlx.nn)": [[244, "mlx.nn.value_and_grad"]], "tree_flatten() (in module mlx.utils)": [[245, "mlx.utils.tree_flatten"]], "tree_map() (in module mlx.utils)": [[246, "mlx.utils.tree_map"]], "tree_unflatten() (in module mlx.utils)": [[247, "mlx.utils.tree_unflatten"]], "stream (class in mlx.core)": [[248, "mlx.core.Stream"]], "__init__() (stream method)": [[248, "mlx.core.Stream.__init__"]], "alibi (class in mlx.nn)": [[257, "mlx.nn.ALiBi"]], "avgpool1d (class in mlx.nn)": [[258, "mlx.nn.AvgPool1d"]], "avgpool2d (class in mlx.nn)": [[259, "mlx.nn.AvgPool2d"]], "batchnorm (class in mlx.nn)": [[260, "mlx.nn.BatchNorm"]], "conv1d (class in mlx.nn)": [[261, "mlx.nn.Conv1d"]], "conv2d (class in mlx.nn)": [[262, "mlx.nn.Conv2d"]], "dropout (class in mlx.nn)": [[263, "mlx.nn.Dropout"]], "dropout2d (class in mlx.nn)": [[264, "mlx.nn.Dropout2d"]], "dropout3d (class in mlx.nn)": [[265, "mlx.nn.Dropout3d"]], "embedding (class in mlx.nn)": [[266, "mlx.nn.Embedding"]], "gelu (class in mlx.nn)": [[267, "mlx.nn.GELU"]], "gru (class in mlx.nn)": [[268, "mlx.nn.GRU"]], "groupnorm (class in mlx.nn)": [[269, "mlx.nn.GroupNorm"]], "instancenorm (class in mlx.nn)": [[270, "mlx.nn.InstanceNorm"]], "lstm (class in mlx.nn)": [[271, "mlx.nn.LSTM"]], "layernorm (class in mlx.nn)": [[272, "mlx.nn.LayerNorm"]], "linear (class in mlx.nn)": [[273, "mlx.nn.Linear"]], "maxpool1d (class in mlx.nn)": [[274, "mlx.nn.MaxPool1d"]], "maxpool2d (class in mlx.nn)": [[275, "mlx.nn.MaxPool2d"]], "mish (class in mlx.nn)": [[276, "mlx.nn.Mish"]], "apply() (module method)": [[277, "mlx.nn.Module.apply"]], "apply_to_modules() (module method)": [[278, "mlx.nn.Module.apply_to_modules"]], "children() (module method)": [[279, "mlx.nn.Module.children"]], "eval() (module method)": [[280, "mlx.nn.Module.eval"]], "filter_and_map() (module method)": [[281, "mlx.nn.Module.filter_and_map"]], "freeze() (module method)": [[282, "mlx.nn.Module.freeze"]], "leaf_modules() (module method)": [[283, "mlx.nn.Module.leaf_modules"]], "load_weights() (module method)": [[284, "mlx.nn.Module.load_weights"]], "modules() (module method)": [[285, "mlx.nn.Module.modules"]], "named_modules() (module method)": [[286, "mlx.nn.Module.named_modules"]], "parameters() (module method)": [[287, "mlx.nn.Module.parameters"]], "save_weights() (module method)": [[288, "mlx.nn.Module.save_weights"]], "set_dtype() (module method)": [[289, "mlx.nn.Module.set_dtype"]], "state (module property)": [[290, "mlx.nn.Module.state"]], "train() (module method)": [[291, "mlx.nn.Module.train"]], "trainable_parameters() (module method)": [[292, "mlx.nn.Module.trainable_parameters"]], "training (module property)": [[293, "mlx.nn.Module.training"]], "unfreeze() (module method)": [[294, "mlx.nn.Module.unfreeze"]], "update() (module method)": [[295, "mlx.nn.Module.update"]], "update_modules() (module method)": [[296, "mlx.nn.Module.update_modules"]], "multiheadattention (class in mlx.nn)": [[297, "mlx.nn.MultiHeadAttention"]], "prelu (class in mlx.nn)": [[298, "mlx.nn.PReLU"]], "quantizedlinear (class in mlx.nn)": [[299, "mlx.nn.QuantizedLinear"]], "rmsnorm (class in mlx.nn)": [[300, "mlx.nn.RMSNorm"]], "rnn (class in mlx.nn)": [[301, "mlx.nn.RNN"]], "relu (class in mlx.nn)": [[302, "mlx.nn.ReLU"]], "rope (class in mlx.nn)": [[303, "mlx.nn.RoPE"]], "selu (class in mlx.nn)": [[304, "mlx.nn.SELU"]], "sequential (class in mlx.nn)": [[305, "mlx.nn.Sequential"]], "silu (class in mlx.nn)": [[306, "mlx.nn.SiLU"]], "sinusoidalpositionalencoding (class in mlx.nn)": [[307, "mlx.nn.SinusoidalPositionalEncoding"]], "softshrink (class in mlx.nn)": [[308, "mlx.nn.Softshrink"]], "step (class in mlx.nn)": [[309, "mlx.nn.Step"]], "transformer (class in mlx.nn)": [[310, "mlx.nn.Transformer"]], "upsample (class in mlx.nn)": [[311, "mlx.nn.Upsample"]], "constant() (in module mlx.nn.init)": [[312, "mlx.nn.init.constant"]], "glorot_normal() (in module mlx.nn.init)": [[313, "mlx.nn.init.glorot_normal"]], "glorot_uniform() (in module mlx.nn.init)": [[314, "mlx.nn.init.glorot_uniform"]], "he_normal() (in module mlx.nn.init)": [[315, "mlx.nn.init.he_normal"]], "he_uniform() (in module mlx.nn.init)": [[316, "mlx.nn.init.he_uniform"]], "identity() (in module mlx.nn.init)": [[317, "mlx.nn.init.identity"]], "normal() (in module mlx.nn.init)": [[318, "mlx.nn.init.normal"]], "uniform() (in module mlx.nn.init)": [[319, "mlx.nn.init.uniform"]], "elu() (in module mlx.nn)": [[320, "mlx.nn.elu"]], "gelu() (in module mlx.nn)": [[321, "mlx.nn.gelu"]], "gelu_approx() (in module mlx.nn)": [[322, "mlx.nn.gelu_approx"]], "gelu_fast_approx() (in module mlx.nn)": [[323, "mlx.nn.gelu_fast_approx"]], "glu() (in module mlx.nn)": [[324, "mlx.nn.glu"]], "hardswish() (in module mlx.nn)": [[325, "mlx.nn.hardswish"]], "leaky_relu() (in module mlx.nn)": [[326, "mlx.nn.leaky_relu"]], "log_sigmoid() (in module mlx.nn)": [[327, "mlx.nn.log_sigmoid"]], "log_softmax() (in module mlx.nn)": [[328, "mlx.nn.log_softmax"]], "binary_cross_entropy() (in module mlx.nn.losses)": [[329, "mlx.nn.losses.binary_cross_entropy"]], "cosine_similarity_loss() (in module mlx.nn.losses)": [[330, "mlx.nn.losses.cosine_similarity_loss"]], "cross_entropy() (in module mlx.nn.losses)": [[331, "mlx.nn.losses.cross_entropy"]], "gaussian_nll_loss() (in module mlx.nn.losses)": [[332, "mlx.nn.losses.gaussian_nll_loss"]], "hinge_loss() (in module mlx.nn.losses)": [[333, "mlx.nn.losses.hinge_loss"]], "huber_loss() (in module mlx.nn.losses)": [[334, "mlx.nn.losses.huber_loss"]], "kl_div_loss() (in module mlx.nn.losses)": [[335, "mlx.nn.losses.kl_div_loss"]], "l1_loss() (in module mlx.nn.losses)": [[336, "mlx.nn.losses.l1_loss"]], "log_cosh_loss() (in module mlx.nn.losses)": [[337, "mlx.nn.losses.log_cosh_loss"]], "margin_ranking_loss() (in module mlx.nn.losses)": [[338, "mlx.nn.losses.margin_ranking_loss"]], "mse_loss() (in module mlx.nn.losses)": [[339, "mlx.nn.losses.mse_loss"]], "nll_loss() (in module mlx.nn.losses)": [[340, "mlx.nn.losses.nll_loss"]], "smooth_l1_loss() (in module mlx.nn.losses)": [[341, "mlx.nn.losses.smooth_l1_loss"]], "triplet_loss() (in module mlx.nn.losses)": [[342, "mlx.nn.losses.triplet_loss"]], "mish() (in module mlx.nn)": [[343, "mlx.nn.mish"]], "prelu() (in module mlx.nn)": [[344, "mlx.nn.prelu"]], "relu() (in module mlx.nn)": [[345, "mlx.nn.relu"]], "relu6() (in module mlx.nn)": [[346, "mlx.nn.relu6"]], "selu() (in module mlx.nn)": [[347, "mlx.nn.selu"]], "sigmoid() (in module mlx.nn)": [[348, "mlx.nn.sigmoid"]], "silu() (in module mlx.nn)": [[349, "mlx.nn.silu"]], "softmax() (in module mlx.nn)": [[350, "mlx.nn.softmax"]], "softplus() (in module mlx.nn)": [[351, "mlx.nn.softplus"]], "softshrink() (in module mlx.nn)": [[352, "mlx.nn.softshrink"]], "step() (in module mlx.nn)": [[353, "mlx.nn.step"]], "tanh() (in module mlx.nn)": [[354, "mlx.nn.tanh"]], "module (class in mlx.nn)": [[359, "mlx.nn.Module"]], "adadelta (class in mlx.optimizers)": [[362, "mlx.optimizers.AdaDelta"]], "adafactor (class in mlx.optimizers)": [[363, "mlx.optimizers.Adafactor"]], "adagrad (class in mlx.optimizers)": [[364, "mlx.optimizers.Adagrad"]], "adam (class in mlx.optimizers)": [[365, "mlx.optimizers.Adam"]], "adamw (class in mlx.optimizers)": [[366, "mlx.optimizers.AdamW"]], "adamax (class in mlx.optimizers)": [[367, "mlx.optimizers.Adamax"]], "lion (class in mlx.optimizers)": [[368, "mlx.optimizers.Lion"]], "apply_gradients() (optimizer method)": [[369, "mlx.optimizers.Optimizer.apply_gradients"]], "init() (optimizer method)": [[370, "mlx.optimizers.Optimizer.init"]], "state (optimizer property)": [[371, "mlx.optimizers.Optimizer.state"]], "update() (optimizer method)": [[372, "mlx.optimizers.Optimizer.update"]], "rmsprop (class in mlx.optimizers)": [[373, "mlx.optimizers.RMSprop"]], "sgd (class in mlx.optimizers)": [[374, "mlx.optimizers.SGD"]], "cosine_decay() (in module mlx.optimizers)": [[375, "mlx.optimizers.cosine_decay"]], "exponential_decay() (in module mlx.optimizers)": [[376, "mlx.optimizers.exponential_decay"]], "join_schedules() (in module mlx.optimizers)": [[377, "mlx.optimizers.join_schedules"]], "linear_schedule() (in module mlx.optimizers)": [[378, "mlx.optimizers.linear_schedule"]], "step_decay() (in module mlx.optimizers)": [[379, "mlx.optimizers.step_decay"]], "optimizer (class in mlx.optimizers)": [[381, "mlx.optimizers.Optimizer"]]}}) \ No newline at end of file +Search.setIndex({"docnames": ["cpp/ops", "dev/extensions", "dev/metal_debugger", "examples/linear_regression", "examples/llama-inference", "examples/mlp", "index", "install", "python/_autosummary/mlx.core.Device", "python/_autosummary/mlx.core.Dtype", "python/_autosummary/mlx.core.DtypeCategory", "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.at", "python/_autosummary/mlx.core.array.cos", "python/_autosummary/mlx.core.array.cummax", "python/_autosummary/mlx.core.array.cummin", "python/_autosummary/mlx.core.array.cumprod", "python/_autosummary/mlx.core.array.cumsum", "python/_autosummary/mlx.core.array.diag", "python/_autosummary/mlx.core.array.diagonal", "python/_autosummary/mlx.core.array.dtype", "python/_autosummary/mlx.core.array.exp", "python/_autosummary/mlx.core.array.flatten", "python/_autosummary/mlx.core.array.item", "python/_autosummary/mlx.core.array.itemsize", "python/_autosummary/mlx.core.array.log", "python/_autosummary/mlx.core.array.log10", "python/_autosummary/mlx.core.array.log1p", "python/_autosummary/mlx.core.array.log2", "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.moveaxis", "python/_autosummary/mlx.core.array.nbytes", "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.squeeze", "python/_autosummary/mlx.core.array.sum", "python/_autosummary/mlx.core.array.swapaxes", "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.atleast_1d", "python/_autosummary/mlx.core.atleast_2d", "python/_autosummary/mlx.core.atleast_3d", "python/_autosummary/mlx.core.block_masked_mm", "python/_autosummary/mlx.core.broadcast_to", "python/_autosummary/mlx.core.ceil", "python/_autosummary/mlx.core.clip", "python/_autosummary/mlx.core.compile", "python/_autosummary/mlx.core.concatenate", "python/_autosummary/mlx.core.conv1d", "python/_autosummary/mlx.core.conv2d", "python/_autosummary/mlx.core.conv_general", "python/_autosummary/mlx.core.convolve", "python/_autosummary/mlx.core.cos", "python/_autosummary/mlx.core.cosh", "python/_autosummary/mlx.core.cummax", "python/_autosummary/mlx.core.cummin", "python/_autosummary/mlx.core.cumprod", "python/_autosummary/mlx.core.cumsum", "python/_autosummary/mlx.core.default_device", "python/_autosummary/mlx.core.default_stream", "python/_autosummary/mlx.core.degrees", "python/_autosummary/mlx.core.dequantize", "python/_autosummary/mlx.core.diag", "python/_autosummary/mlx.core.diagonal", "python/_autosummary/mlx.core.disable_compile", "python/_autosummary/mlx.core.divide", "python/_autosummary/mlx.core.divmod", "python/_autosummary/mlx.core.enable_compile", "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.expm1", "python/_autosummary/mlx.core.eye", "python/_autosummary/mlx.core.fast.layer_norm", "python/_autosummary/mlx.core.fast.rms_norm", "python/_autosummary/mlx.core.fast.rope", "python/_autosummary/mlx.core.fast.scaled_dot_product_attention", "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.isclose", "python/_autosummary/mlx.core.isinf", "python/_autosummary/mlx.core.isnan", "python/_autosummary/mlx.core.isneginf", "python/_autosummary/mlx.core.isposinf", "python/_autosummary/mlx.core.issubdtype", "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.linalg.qr", "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.meshgrid", "python/_autosummary/mlx.core.metal.clear_cache", "python/_autosummary/mlx.core.metal.get_active_memory", "python/_autosummary/mlx.core.metal.get_cache_memory", "python/_autosummary/mlx.core.metal.get_peak_memory", "python/_autosummary/mlx.core.metal.is_available", "python/_autosummary/mlx.core.metal.set_cache_limit", "python/_autosummary/mlx.core.metal.set_memory_limit", "python/_autosummary/mlx.core.metal.start_capture", "python/_autosummary/mlx.core.metal.stop_capture", "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.not_equal", "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.radians", "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.multivariate_normal", "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.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.std", "python/_autosummary/mlx.core.stop_gradient", "python/_autosummary/mlx.core.stream", "python/_autosummary/mlx.core.subtract", "python/_autosummary/mlx.core.sum", "python/_autosummary/mlx.core.swapaxes", "python/_autosummary/mlx.core.synchronize", "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.tile", "python/_autosummary/mlx.core.topk", "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.quantize", "python/_autosummary/mlx.nn.value_and_grad", "python/_autosummary/mlx.utils.tree_flatten", "python/_autosummary/mlx.utils.tree_map", "python/_autosummary/mlx.utils.tree_map_with_path", "python/_autosummary/mlx.utils.tree_unflatten", "python/_autosummary/stream_class", "python/array", "python/data_types", "python/devices_and_streams", "python/fast", "python/fft", "python/linalg", "python/metal", "python/nn", "python/nn/_autosummary/mlx.nn.ALiBi", "python/nn/_autosummary/mlx.nn.AvgPool1d", "python/nn/_autosummary/mlx.nn.AvgPool2d", "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.GRU", "python/nn/_autosummary/mlx.nn.GroupNorm", "python/nn/_autosummary/mlx.nn.InstanceNorm", "python/nn/_autosummary/mlx.nn.LSTM", "python/nn/_autosummary/mlx.nn.LayerNorm", "python/nn/_autosummary/mlx.nn.Linear", "python/nn/_autosummary/mlx.nn.MaxPool1d", "python/nn/_autosummary/mlx.nn.MaxPool2d", "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.set_dtype", "python/nn/_autosummary/mlx.nn.Module.state", "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.QuantizedEmbedding", "python/nn/_autosummary/mlx.nn.QuantizedLinear", "python/nn/_autosummary/mlx.nn.RMSNorm", "python/nn/_autosummary/mlx.nn.RNN", "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.Softshrink", "python/nn/_autosummary/mlx.nn.Step", "python/nn/_autosummary/mlx.nn.Transformer", "python/nn/_autosummary/mlx.nn.Upsample", "python/nn/_autosummary/mlx.nn.init.constant", "python/nn/_autosummary/mlx.nn.init.glorot_normal", "python/nn/_autosummary/mlx.nn.init.glorot_uniform", "python/nn/_autosummary/mlx.nn.init.he_normal", "python/nn/_autosummary/mlx.nn.init.he_uniform", "python/nn/_autosummary/mlx.nn.init.identity", "python/nn/_autosummary/mlx.nn.init.normal", "python/nn/_autosummary/mlx.nn.init.uniform", "python/nn/_autosummary_functions/mlx.nn.elu", "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.glu", "python/nn/_autosummary_functions/mlx.nn.hardswish", "python/nn/_autosummary_functions/mlx.nn.leaky_relu", "python/nn/_autosummary_functions/mlx.nn.log_sigmoid", "python/nn/_autosummary_functions/mlx.nn.log_softmax", "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.gaussian_nll_loss", "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.margin_ranking_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.relu6", "python/nn/_autosummary_functions/mlx.nn.selu", "python/nn/_autosummary_functions/mlx.nn.sigmoid", "python/nn/_autosummary_functions/mlx.nn.silu", "python/nn/_autosummary_functions/mlx.nn.softmax", "python/nn/_autosummary_functions/mlx.nn.softplus", "python/nn/_autosummary_functions/mlx.nn.softshrink", "python/nn/_autosummary_functions/mlx.nn.step", "python/nn/_autosummary_functions/mlx.nn.tanh", "python/nn/functions", "python/nn/init", "python/nn/layers", "python/nn/losses", "python/nn/module", "python/ops", "python/optimizers", "python/optimizers/_autosummary/mlx.optimizers.AdaDelta", "python/optimizers/_autosummary/mlx.optimizers.Adafactor", "python/optimizers/_autosummary/mlx.optimizers.Adagrad", "python/optimizers/_autosummary/mlx.optimizers.Adam", "python/optimizers/_autosummary/mlx.optimizers.AdamW", "python/optimizers/_autosummary/mlx.optimizers.Adamax", "python/optimizers/_autosummary/mlx.optimizers.Lion", "python/optimizers/_autosummary/mlx.optimizers.Optimizer.apply_gradients", "python/optimizers/_autosummary/mlx.optimizers.Optimizer.init", "python/optimizers/_autosummary/mlx.optimizers.Optimizer.state", "python/optimizers/_autosummary/mlx.optimizers.Optimizer.update", "python/optimizers/_autosummary/mlx.optimizers.RMSprop", "python/optimizers/_autosummary/mlx.optimizers.SGD", "python/optimizers/_autosummary/mlx.optimizers.cosine_decay", "python/optimizers/_autosummary/mlx.optimizers.exponential_decay", "python/optimizers/_autosummary/mlx.optimizers.join_schedules", "python/optimizers/_autosummary/mlx.optimizers.linear_schedule", "python/optimizers/_autosummary/mlx.optimizers.step_decay", "python/optimizers/common_optimizers", "python/optimizers/optimizer", "python/optimizers/schedulers", "python/random", "python/transforms", "python/tree_utils", "usage/compile", "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", "dev/metal_debugger.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.DtypeCategory.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.at.rst", "python/_autosummary/mlx.core.array.cos.rst", "python/_autosummary/mlx.core.array.cummax.rst", "python/_autosummary/mlx.core.array.cummin.rst", "python/_autosummary/mlx.core.array.cumprod.rst", "python/_autosummary/mlx.core.array.cumsum.rst", "python/_autosummary/mlx.core.array.diag.rst", "python/_autosummary/mlx.core.array.diagonal.rst", "python/_autosummary/mlx.core.array.dtype.rst", "python/_autosummary/mlx.core.array.exp.rst", "python/_autosummary/mlx.core.array.flatten.rst", "python/_autosummary/mlx.core.array.item.rst", "python/_autosummary/mlx.core.array.itemsize.rst", "python/_autosummary/mlx.core.array.log.rst", "python/_autosummary/mlx.core.array.log10.rst", "python/_autosummary/mlx.core.array.log1p.rst", "python/_autosummary/mlx.core.array.log2.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.moveaxis.rst", "python/_autosummary/mlx.core.array.nbytes.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.squeeze.rst", "python/_autosummary/mlx.core.array.sum.rst", "python/_autosummary/mlx.core.array.swapaxes.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.atleast_1d.rst", "python/_autosummary/mlx.core.atleast_2d.rst", "python/_autosummary/mlx.core.atleast_3d.rst", "python/_autosummary/mlx.core.block_masked_mm.rst", "python/_autosummary/mlx.core.broadcast_to.rst", "python/_autosummary/mlx.core.ceil.rst", "python/_autosummary/mlx.core.clip.rst", "python/_autosummary/mlx.core.compile.rst", "python/_autosummary/mlx.core.concatenate.rst", "python/_autosummary/mlx.core.conv1d.rst", "python/_autosummary/mlx.core.conv2d.rst", "python/_autosummary/mlx.core.conv_general.rst", "python/_autosummary/mlx.core.convolve.rst", "python/_autosummary/mlx.core.cos.rst", "python/_autosummary/mlx.core.cosh.rst", "python/_autosummary/mlx.core.cummax.rst", "python/_autosummary/mlx.core.cummin.rst", "python/_autosummary/mlx.core.cumprod.rst", "python/_autosummary/mlx.core.cumsum.rst", "python/_autosummary/mlx.core.default_device.rst", "python/_autosummary/mlx.core.default_stream.rst", "python/_autosummary/mlx.core.degrees.rst", "python/_autosummary/mlx.core.dequantize.rst", "python/_autosummary/mlx.core.diag.rst", "python/_autosummary/mlx.core.diagonal.rst", "python/_autosummary/mlx.core.disable_compile.rst", "python/_autosummary/mlx.core.divide.rst", "python/_autosummary/mlx.core.divmod.rst", "python/_autosummary/mlx.core.enable_compile.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.expm1.rst", "python/_autosummary/mlx.core.eye.rst", "python/_autosummary/mlx.core.fast.layer_norm.rst", "python/_autosummary/mlx.core.fast.rms_norm.rst", "python/_autosummary/mlx.core.fast.rope.rst", "python/_autosummary/mlx.core.fast.scaled_dot_product_attention.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.isclose.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.issubdtype.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.linalg.qr.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.meshgrid.rst", "python/_autosummary/mlx.core.metal.clear_cache.rst", "python/_autosummary/mlx.core.metal.get_active_memory.rst", "python/_autosummary/mlx.core.metal.get_cache_memory.rst", "python/_autosummary/mlx.core.metal.get_peak_memory.rst", "python/_autosummary/mlx.core.metal.is_available.rst", "python/_autosummary/mlx.core.metal.set_cache_limit.rst", "python/_autosummary/mlx.core.metal.set_memory_limit.rst", "python/_autosummary/mlx.core.metal.start_capture.rst", "python/_autosummary/mlx.core.metal.stop_capture.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.not_equal.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.radians.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.multivariate_normal.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.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.std.rst", "python/_autosummary/mlx.core.stop_gradient.rst", "python/_autosummary/mlx.core.stream.rst", "python/_autosummary/mlx.core.subtract.rst", "python/_autosummary/mlx.core.sum.rst", "python/_autosummary/mlx.core.swapaxes.rst", "python/_autosummary/mlx.core.synchronize.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.tile.rst", "python/_autosummary/mlx.core.topk.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.quantize.rst", "python/_autosummary/mlx.nn.value_and_grad.rst", "python/_autosummary/mlx.utils.tree_flatten.rst", "python/_autosummary/mlx.utils.tree_map.rst", "python/_autosummary/mlx.utils.tree_map_with_path.rst", "python/_autosummary/mlx.utils.tree_unflatten.rst", "python/_autosummary/stream_class.rst", "python/array.rst", "python/data_types.rst", "python/devices_and_streams.rst", "python/fast.rst", "python/fft.rst", "python/linalg.rst", "python/metal.rst", "python/nn.rst", "python/nn/_autosummary/mlx.nn.ALiBi.rst", "python/nn/_autosummary/mlx.nn.AvgPool1d.rst", "python/nn/_autosummary/mlx.nn.AvgPool2d.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.GRU.rst", "python/nn/_autosummary/mlx.nn.GroupNorm.rst", "python/nn/_autosummary/mlx.nn.InstanceNorm.rst", "python/nn/_autosummary/mlx.nn.LSTM.rst", "python/nn/_autosummary/mlx.nn.LayerNorm.rst", "python/nn/_autosummary/mlx.nn.Linear.rst", "python/nn/_autosummary/mlx.nn.MaxPool1d.rst", "python/nn/_autosummary/mlx.nn.MaxPool2d.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.set_dtype.rst", "python/nn/_autosummary/mlx.nn.Module.state.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.QuantizedEmbedding.rst", "python/nn/_autosummary/mlx.nn.QuantizedLinear.rst", "python/nn/_autosummary/mlx.nn.RMSNorm.rst", "python/nn/_autosummary/mlx.nn.RNN.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.Softshrink.rst", "python/nn/_autosummary/mlx.nn.Step.rst", "python/nn/_autosummary/mlx.nn.Transformer.rst", "python/nn/_autosummary/mlx.nn.Upsample.rst", "python/nn/_autosummary/mlx.nn.init.constant.rst", "python/nn/_autosummary/mlx.nn.init.glorot_normal.rst", "python/nn/_autosummary/mlx.nn.init.glorot_uniform.rst", "python/nn/_autosummary/mlx.nn.init.he_normal.rst", "python/nn/_autosummary/mlx.nn.init.he_uniform.rst", "python/nn/_autosummary/mlx.nn.init.identity.rst", "python/nn/_autosummary/mlx.nn.init.normal.rst", "python/nn/_autosummary/mlx.nn.init.uniform.rst", "python/nn/_autosummary_functions/mlx.nn.elu.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.glu.rst", "python/nn/_autosummary_functions/mlx.nn.hardswish.rst", "python/nn/_autosummary_functions/mlx.nn.leaky_relu.rst", "python/nn/_autosummary_functions/mlx.nn.log_sigmoid.rst", "python/nn/_autosummary_functions/mlx.nn.log_softmax.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.gaussian_nll_loss.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.margin_ranking_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.relu6.rst", "python/nn/_autosummary_functions/mlx.nn.selu.rst", "python/nn/_autosummary_functions/mlx.nn.sigmoid.rst", "python/nn/_autosummary_functions/mlx.nn.silu.rst", "python/nn/_autosummary_functions/mlx.nn.softmax.rst", "python/nn/_autosummary_functions/mlx.nn.softplus.rst", "python/nn/_autosummary_functions/mlx.nn.softshrink.rst", "python/nn/_autosummary_functions/mlx.nn.step.rst", "python/nn/_autosummary_functions/mlx.nn.tanh.rst", "python/nn/functions.rst", "python/nn/init.rst", "python/nn/layers.rst", "python/nn/losses.rst", "python/nn/module.rst", "python/ops.rst", "python/optimizers.rst", "python/optimizers/_autosummary/mlx.optimizers.AdaDelta.rst", "python/optimizers/_autosummary/mlx.optimizers.Adafactor.rst", "python/optimizers/_autosummary/mlx.optimizers.Adagrad.rst", "python/optimizers/_autosummary/mlx.optimizers.Adam.rst", "python/optimizers/_autosummary/mlx.optimizers.AdamW.rst", "python/optimizers/_autosummary/mlx.optimizers.Adamax.rst", "python/optimizers/_autosummary/mlx.optimizers.Lion.rst", "python/optimizers/_autosummary/mlx.optimizers.Optimizer.apply_gradients.rst", "python/optimizers/_autosummary/mlx.optimizers.Optimizer.init.rst", "python/optimizers/_autosummary/mlx.optimizers.Optimizer.state.rst", "python/optimizers/_autosummary/mlx.optimizers.Optimizer.update.rst", "python/optimizers/_autosummary/mlx.optimizers.RMSprop.rst", "python/optimizers/_autosummary/mlx.optimizers.SGD.rst", "python/optimizers/_autosummary/mlx.optimizers.cosine_decay.rst", "python/optimizers/_autosummary/mlx.optimizers.exponential_decay.rst", "python/optimizers/_autosummary/mlx.optimizers.join_schedules.rst", "python/optimizers/_autosummary/mlx.optimizers.linear_schedule.rst", "python/optimizers/_autosummary/mlx.optimizers.step_decay.rst", "python/optimizers/common_optimizers.rst", "python/optimizers/optimizer.rst", "python/optimizers/schedulers.rst", "python/random.rst", "python/transforms.rst", "python/tree_utils.rst", "usage/compile.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", "Metal Debugger", "Linear Regression", "LLM inference", "Multi-Layer Perceptron", "MLX", "Build and Install", "mlx.core.Device", "mlx.core.Dtype", "mlx.core.DtypeCategory", "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.at", "mlx.core.array.cos", "mlx.core.array.cummax", "mlx.core.array.cummin", "mlx.core.array.cumprod", "mlx.core.array.cumsum", "mlx.core.array.diag", "mlx.core.array.diagonal", "mlx.core.array.dtype", "mlx.core.array.exp", "mlx.core.array.flatten", "mlx.core.array.item", "mlx.core.array.itemsize", "mlx.core.array.log", "mlx.core.array.log10", "mlx.core.array.log1p", "mlx.core.array.log2", "mlx.core.array.logsumexp", "mlx.core.array.max", "mlx.core.array.mean", "mlx.core.array.min", "mlx.core.array.moveaxis", "mlx.core.array.nbytes", "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.squeeze", "mlx.core.array.sum", "mlx.core.array.swapaxes", "mlx.core.array.tolist", "mlx.core.array.transpose", "mlx.core.array.var", "mlx.core.array_equal", "mlx.core.atleast_1d", "mlx.core.atleast_2d", "mlx.core.atleast_3d", "mlx.core.block_masked_mm", "mlx.core.broadcast_to", "mlx.core.ceil", "mlx.core.clip", "mlx.core.compile", "mlx.core.concatenate", "mlx.core.conv1d", "mlx.core.conv2d", "mlx.core.conv_general", "mlx.core.convolve", "mlx.core.cos", "mlx.core.cosh", "mlx.core.cummax", "mlx.core.cummin", "mlx.core.cumprod", "mlx.core.cumsum", "mlx.core.default_device", "mlx.core.default_stream", "mlx.core.degrees", "mlx.core.dequantize", "mlx.core.diag", "mlx.core.diagonal", "mlx.core.disable_compile", "mlx.core.divide", "mlx.core.divmod", "mlx.core.enable_compile", "mlx.core.equal", "mlx.core.erf", "mlx.core.erfinv", "mlx.core.eval", "mlx.core.exp", "mlx.core.expand_dims", "mlx.core.expm1", "mlx.core.eye", "mlx.core.fast.layer_norm", "mlx.core.fast.rms_norm", "mlx.core.fast.rope", "mlx.core.fast.scaled_dot_product_attention", "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.isclose", "mlx.core.isinf", "mlx.core.isnan", "mlx.core.isneginf", "mlx.core.isposinf", "mlx.core.issubdtype", "mlx.core.jvp", "mlx.core.less", "mlx.core.less_equal", "mlx.core.linalg.norm", "mlx.core.linalg.qr", "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.meshgrid", "mlx.core.metal.clear_cache", "mlx.core.metal.get_active_memory", "mlx.core.metal.get_cache_memory", "mlx.core.metal.get_peak_memory", "mlx.core.metal.is_available", "mlx.core.metal.set_cache_limit", "mlx.core.metal.set_memory_limit", "mlx.core.metal.start_capture", "mlx.core.metal.stop_capture", "mlx.core.min", "mlx.core.minimum", "mlx.core.moveaxis", "mlx.core.multiply", "mlx.core.negative", "mlx.core.new_stream", "mlx.core.not_equal", "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.radians", "mlx.core.random.bernoulli", "mlx.core.random.categorical", "mlx.core.random.gumbel", "mlx.core.random.key", "mlx.core.random.multivariate_normal", "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.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.std", "mlx.core.stop_gradient", "mlx.core.stream", "mlx.core.subtract", "mlx.core.sum", "mlx.core.swapaxes", "mlx.core.synchronize", "mlx.core.take", "mlx.core.take_along_axis", "mlx.core.tan", "mlx.core.tanh", "mlx.core.tensordot", "mlx.core.tile", "mlx.core.topk", "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.quantize", "mlx.nn.value_and_grad", "mlx.utils.tree_flatten", "mlx.utils.tree_map", "mlx.utils.tree_map_with_path", "mlx.utils.tree_unflatten", "mlx.core.Stream", "Array", "Data Types", "Devices and Streams", "Fast", "FFT", "Linear Algebra", "Metal", "Neural Networks", "mlx.nn.ALiBi", "mlx.nn.AvgPool1d", "mlx.nn.AvgPool2d", "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.GRU", "mlx.nn.GroupNorm", "mlx.nn.InstanceNorm", "mlx.nn.LSTM", "mlx.nn.LayerNorm", "mlx.nn.Linear", "mlx.nn.MaxPool1d", "mlx.nn.MaxPool2d", "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.set_dtype", "mlx.nn.Module.state", "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.QuantizedEmbedding", "mlx.nn.QuantizedLinear", "mlx.nn.RMSNorm", "mlx.nn.RNN", "mlx.nn.ReLU", "mlx.nn.RoPE", "mlx.nn.SELU", "mlx.nn.Sequential", "mlx.nn.SiLU", "mlx.nn.SinusoidalPositionalEncoding", "mlx.nn.Softshrink", "mlx.nn.Step", "mlx.nn.Transformer", "mlx.nn.Upsample", "mlx.nn.init.constant", "mlx.nn.init.glorot_normal", "mlx.nn.init.glorot_uniform", "mlx.nn.init.he_normal", "mlx.nn.init.he_uniform", "mlx.nn.init.identity", "mlx.nn.init.normal", "mlx.nn.init.uniform", "mlx.nn.elu", "mlx.nn.gelu", "mlx.nn.gelu_approx", "mlx.nn.gelu_fast_approx", "mlx.nn.glu", "mlx.nn.hardswish", "mlx.nn.leaky_relu", "mlx.nn.log_sigmoid", "mlx.nn.log_softmax", "mlx.nn.losses.binary_cross_entropy", "mlx.nn.losses.cosine_similarity_loss", "mlx.nn.losses.cross_entropy", "mlx.nn.losses.gaussian_nll_loss", "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.margin_ranking_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.relu6", "mlx.nn.selu", "mlx.nn.sigmoid", "mlx.nn.silu", "mlx.nn.softmax", "mlx.nn.softplus", "mlx.nn.softshrink", "mlx.nn.step", "mlx.nn.tanh", "Functions", "Initializers", "Layers", "Loss Functions", "Module", "Operations", "Optimizers", "mlx.optimizers.AdaDelta", "mlx.optimizers.Adafactor", "mlx.optimizers.Adagrad", "mlx.optimizers.Adam", "mlx.optimizers.AdamW", "mlx.optimizers.Adamax", "mlx.optimizers.Lion", "mlx.optimizers.Optimizer.apply_gradients", "mlx.optimizers.Optimizer.init", "mlx.optimizers.Optimizer.state", "mlx.optimizers.Optimizer.update", "mlx.optimizers.RMSprop", "mlx.optimizers.SGD", "mlx.optimizers.cosine_decay", "mlx.optimizers.exponential_decay", "mlx.optimizers.join_schedules", "mlx.optimizers.linear_schedule", "mlx.optimizers.step_decay", "Common Optimizers", "Optimizer", "Schedulers", "Random", "Transforms", "Tree Utils", "Compilation", "Function Transforms", "Indexing Arrays", "Lazy Evaluation", "Conversion to NumPy and Other Frameworks", "Quick Start Guide", "Saving and Loading Arrays", "Unified Memory", "Using Streams"], "terms": {"you": [1, 2, 4, 5, 6, 7, 264, 316, 319, 365, 392, 395, 396, 397, 399, 401, 402], "can": [1, 2, 4, 6, 7, 12, 16, 61, 74, 84, 101, 102, 103, 104, 106, 109, 135, 136, 146, 147, 148, 156, 163, 176, 178, 181, 191, 192, 197, 200, 201, 208, 228, 243, 264, 267, 274, 283, 289, 302, 307, 314, 320, 340, 365, 368, 370, 378, 379, 392, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403], "extend": [1, 185], "mlx": [1, 2, 3, 4, 5, 7, 264, 365, 368, 370, 392, 394, 395, 396, 397, 398, 399, 400, 401, 402], "custom": [1, 319], "thi": [1, 4, 5, 7, 13, 14, 15, 16, 23, 24, 25, 26, 105, 139, 145, 148, 149, 156, 160, 161, 162, 164, 166, 167, 175, 186, 187, 192, 213, 218, 219, 220, 225, 229, 232, 238, 244, 254, 264, 271, 272, 273, 276, 279, 286, 287, 289, 290, 293, 294, 295, 300, 302, 303, 304, 305, 308, 310, 318, 322, 323, 324, 325, 331, 332, 333, 346, 362, 368, 379, 394, 395, 396, 398, 399, 401], "guid": [1, 6], "explain": 1, "how": [1, 4, 5, 264, 266, 267, 269, 270, 274, 282, 283, 307, 320, 378, 395, 397, 402], "do": [1, 4, 7, 264, 291, 302, 365, 368, 375, 395, 396, 398], "simpl": [1, 4, 5, 264, 274, 364, 395, 396, 398], "let": [1, 3, 4, 395, 396, 398, 399], "": [1, 3, 4, 5, 43, 47, 58, 84, 97, 99, 119, 120, 122, 123, 125, 126, 128, 129, 134, 148, 151, 164, 184, 188, 192, 205, 208, 209, 225, 227, 243, 244, 246, 251, 264, 267, 276, 279, 283, 289, 290, 292, 296, 297, 298, 302, 310, 370, 379, 380, 392, 395, 396, 398, 399, 400, 401, 402], "sai": [1, 4, 365, 398], "would": [1, 4, 320, 397, 398, 399, 402], "like": [1, 4, 6, 144, 183, 249, 273, 346, 379, 381, 395, 396, 398, 399, 400, 402], "an": [1, 2, 4, 5, 7, 9, 13, 15, 27, 77, 78, 79, 81, 86, 87, 88, 109, 113, 114, 117, 130, 133, 137, 148, 151, 172, 177, 182, 183, 185, 187, 188, 189, 203, 204, 205, 220, 223, 230, 232, 233, 236, 237, 240, 246, 248, 249, 252, 253, 254, 264, 266, 267, 271, 277, 279, 280, 281, 282, 283, 285, 305, 306, 308, 310, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 331, 353, 365, 371, 381, 385, 390, 392, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403], "take": [1, 4, 5, 84, 134, 145, 163, 176, 183, 189, 233, 243, 245, 246, 249, 254, 305, 392, 396, 397, 401, 402, 403], "two": [1, 12, 14, 76, 78, 80, 101, 103, 106, 119, 122, 128, 135, 136, 139, 146, 147, 149, 156, 161, 163, 176, 178, 181, 184, 230, 267, 279, 283, 333, 339, 395, 396, 397, 402], "arrai": [1, 4, 5, 6, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 98, 99, 100, 101, 103, 104, 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, 175, 176, 177, 178, 179, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 228, 229, 230, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 264, 268, 279, 285, 292, 295, 300, 306, 320, 321, 322, 323, 324, 325, 326, 327, 328, 333, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 362, 365, 368, 371, 372, 373, 374, 375, 376, 377, 382, 383, 384, 385, 386, 387, 388, 395, 396, 398, 399, 400, 402], "x": [1, 3, 4, 5, 35, 80, 107, 112, 114, 115, 137, 148, 189, 193, 205, 210, 214, 241, 242, 247, 253, 264, 266, 267, 268, 275, 277, 278, 280, 281, 282, 283, 284, 285, 306, 309, 311, 316, 318, 320, 329, 330, 331, 332, 333, 334, 335, 336, 337, 350, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 368, 370, 377, 395, 396, 397, 398, 399, 400, 402], "y": [1, 3, 4, 5, 35, 247, 264, 268, 272, 277, 278, 280, 281, 309, 342, 347, 350, 370, 373, 395, 396, 398, 399], "scale": [1, 4, 99, 114, 115, 116, 117, 188, 189, 196, 272, 273, 280, 305, 312, 313, 316, 320, 356, 372], "them": [1, 4, 264, 290, 302, 402], "both": [1, 12, 103, 104, 106, 135, 136, 144, 146, 147, 148, 156, 163, 176, 178, 181, 192, 228, 266, 267, 278, 279, 282, 283, 370, 395, 396, 400, 402], "coeffici": [1, 371, 372, 374, 375, 376, 377], "alpha": [1, 188, 329, 351, 353, 356, 375, 382], "beta": [1, 99, 188, 268, 277, 278, 280, 350, 374, 375, 376, 377], "respect": [1, 3, 5, 114, 115, 134, 188, 243, 253, 264, 268, 275, 277, 278, 280, 368, 396, 400], "add": [1, 2, 4, 35, 111, 156, 185, 188, 269, 270, 396, 402], "togeth": [1, 5, 188, 253, 254], "get": [1, 3, 5, 7, 87, 88, 96, 97, 167, 168, 169, 194, 264, 395, 396, 398, 402], "z": [1, 276, 395, 398], "directli": [1, 4], "import": [1, 2, 3, 4, 5, 7, 148, 210, 243, 252, 253, 254, 255, 264, 266, 267, 268, 278, 282, 283, 292, 320, 338, 340, 347, 365, 368, 395, 396, 397, 398, 399, 400], "core": [1, 2, 3, 4, 5, 250, 264, 266, 267, 268, 278, 282, 283, 292, 295, 297, 300, 320, 321, 322, 323, 324, 325, 326, 327, 328, 338, 340, 347, 365, 368, 370, 395, 399, 400], "mx": [1, 2, 3, 4, 5, 35, 130, 144, 148, 149, 151, 210, 243, 264, 266, 267, 268, 278, 282, 283, 285, 292, 296, 311, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 335, 338, 339, 340, 344, 347, 354, 363, 365, 368, 370, 392, 395, 396, 397, 398, 399, 400, 401, 402, 403], "def": [1, 3, 4, 5, 243, 264, 368, 395, 396, 397, 398, 399, 402], "simple_axpbi": 1, "float": [1, 10, 14, 16, 73, 114, 115, 116, 117, 132, 133, 139, 144, 148, 189, 191, 196, 258, 268, 271, 272, 273, 277, 278, 280, 285, 297, 309, 312, 316, 318, 319, 320, 321, 322, 323, 324, 325, 327, 328, 339, 340, 341, 343, 347, 350, 351, 361, 362, 371, 372, 373, 374, 375, 376, 377, 382, 383, 384, 385, 387, 388], "return": [1, 3, 4, 5, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 34, 46, 64, 73, 76, 77, 78, 79, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 98, 99, 100, 101, 103, 104, 106, 107, 108, 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, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 168, 171, 172, 175, 176, 177, 178, 179, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 199, 200, 201, 202, 203, 204, 205, 206, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 264, 276, 279, 285, 286, 287, 289, 290, 291, 292, 293, 294, 295, 299, 300, 302, 303, 304, 310, 321, 322, 323, 324, 325, 326, 327, 328, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 365, 368, 378, 394, 395, 396, 397, 398, 399, 401, 402], "function": [1, 2, 3, 4, 5, 6, 14, 84, 104, 107, 108, 134, 139, 145, 148, 149, 161, 214, 243, 245, 246, 251, 253, 254, 264, 275, 284, 286, 290, 297, 302, 306, 310, 311, 313, 314, 315, 317, 318, 319, 330, 331, 332, 333, 334, 336, 337, 352, 357, 359, 360, 361, 362, 363, 365, 370, 379, 392, 394, 397, 398, 399, 401], "perform": [1, 2, 4, 6, 80, 88, 92, 93, 94, 95, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 161, 189, 205, 218, 232, 264, 277, 319, 324, 325, 395, 397, 398, 402], "while": [1, 2, 4, 7, 204, 312, 398, 399], "leav": [1, 109, 253, 254], "howev": [1, 264, 275, 277, 379, 392, 395, 398, 399], "mai": [1, 148, 250, 272, 396, 397], "need": [1, 4, 5, 6, 76, 188, 264, 303, 304, 316, 319, 392, 396, 398, 399, 400, 402], "underli": 1, "perhap": [1, 4], "make": [1, 2, 4, 5, 7, 161, 180, 213, 264, 384, 385, 387, 388, 395, 398, 400, 402], "faster": [1, 104, 330, 395, 396], "differenti": [1, 6], "In": [1, 4, 5, 35, 161, 188, 253, 264, 272, 277, 368, 371, 373, 374, 376, 377, 378, 394, 395, 396, 398, 401, 402], "tutori": 1, "we": [1, 3, 4, 5, 99, 188, 189, 264, 274, 307, 314, 375, 377, 392, 394, 395, 396, 398, 402], "go": [1, 4, 396], "through": [1, 226, 319, 377, 395, 396, 399], "ad": [1, 3, 7, 114, 278, 368, 371, 372, 373, 374, 375, 376, 382, 398, 401], "extens": [1, 151, 173, 296, 401], "It": [1, 4, 7, 134, 213, 243, 264, 304, 308, 378, 390, 399, 401], "cover": 1, "The": [1, 2, 4, 5, 6, 7, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 34, 43, 47, 57, 58, 64, 73, 76, 77, 78, 79, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 98, 99, 100, 101, 103, 104, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 135, 136, 137, 138, 139, 140, 141, 142, 143, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 168, 169, 171, 172, 173, 175, 176, 177, 178, 179, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 199, 200, 201, 202, 203, 204, 208, 209, 214, 215, 216, 217, 218, 219, 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, 258, 266, 267, 268, 269, 270, 271, 272, 273, 274, 276, 277, 278, 279, 280, 281, 282, 283, 285, 286, 290, 292, 296, 297, 298, 299, 302, 303, 304, 305, 307, 308, 309, 310, 312, 314, 316, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 333, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 362, 365, 368, 370, 371, 372, 373, 374, 375, 376, 377, 380, 382, 383, 384, 387, 390, 395, 396, 397, 398, 399, 400, 401, 402, 403], "structur": [1, 378, 396], "librari": [1, 7, 264], "redirect": 1, "acceler": [1, 268], "when": [1, 4, 6, 7, 84, 88, 148, 151, 269, 270, 320, 324, 325, 344, 350, 368, 386, 392, 395, 402], "appropri": [1, 395], "metal": [1, 6], "vjp": [1, 400], "jvp": [1, 400], "comput": [1, 3, 4, 5, 6, 7, 92, 93, 94, 95, 99, 112, 116, 134, 145, 148, 156, 164, 184, 188, 218, 225, 226, 236, 243, 244, 245, 251, 264, 268, 276, 277, 278, 279, 280, 290, 303, 308, 309, 312, 319, 322, 323, 324, 325, 331, 332, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 370, 371, 372, 374, 375, 376, 377, 381, 395, 396, 400, 402], "graph": [1, 4, 5, 6, 396], "provid": [1, 4, 99, 134, 236, 243, 253, 264, 285, 290, 292, 302, 303, 304, 307, 308, 319, 320, 364, 368, 401, 403], "rule": 1, "evalu": [1, 4, 5, 6, 109, 145, 245, 264, 288, 299, 368, 370, 395, 400], "start": [1, 3, 4, 6, 7, 16, 116, 150, 173, 220, 395, 397, 402], "discuss": 1, "more": [1, 2, 5, 9, 73, 101, 161, 171, 172, 208, 209, 258, 264, 268, 272, 312, 316, 319, 320, 322, 323, 324, 325, 392, 395, 396, 397, 400, 402], "detail": [1, 9, 171, 264, 272, 312, 316, 320, 322, 323, 324, 325, 371, 373, 374, 376, 377, 397, 400], "ar": [1, 3, 4, 5, 6, 7, 14, 16, 76, 80, 81, 83, 84, 88, 89, 101, 109, 113, 119, 120, 122, 123, 125, 126, 128, 129, 130, 134, 139, 140, 141, 142, 143, 144, 145, 148, 149, 151, 161, 172, 184, 185, 186, 188, 189, 191, 192, 193, 197, 200, 201, 210, 211, 223, 224, 232, 243, 245, 246, 250, 252, 253, 258, 268, 269, 270, 271, 272, 273, 277, 278, 280, 281, 292, 305, 308, 320, 338, 340, 341, 364, 368, 377, 379, 394, 395, 396, 397, 398, 399, 400, 401, 402], "front": 1, "thei": [1, 3, 4, 14, 89, 139, 314, 342, 368, 377, 394, 395, 398, 400, 401, 402], "defin": [1, 3, 4, 5, 7, 148, 189, 252, 399], "c": [1, 4, 148, 266, 267, 268, 269, 270, 272, 273, 278, 279, 282, 283, 399, 400, 402], "api": [1, 396], "axpbi": 1, "scalar": [1, 12, 14, 27, 46, 73, 76, 80, 81, 83, 103, 104, 106, 132, 133, 134, 135, 136, 139, 146, 147, 148, 150, 156, 157, 158, 159, 161, 163, 176, 178, 181, 185, 191, 197, 200, 201, 208, 228, 243, 247, 251, 351, 396, 398, 400], "i": [1, 2, 4, 5, 6, 7, 14, 16, 25, 34, 73, 83, 86, 87, 88, 89, 92, 93, 94, 95, 100, 101, 104, 109, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 132, 133, 139, 144, 145, 148, 149, 151, 156, 160, 161, 165, 169, 170, 172, 185, 186, 188, 189, 191, 192, 195, 196, 199, 200, 201, 204, 207, 208, 209, 214, 218, 220, 225, 226, 231, 232, 233, 236, 239, 243, 244, 245, 246, 247, 250, 252, 253, 254, 258, 264, 266, 267, 268, 269, 270, 271, 272, 273, 275, 276, 277, 278, 279, 280, 281, 282, 283, 289, 290, 296, 298, 299, 301, 302, 304, 305, 306, 308, 309, 310, 312, 316, 318, 319, 320, 324, 325, 330, 332, 338, 339, 341, 346, 347, 350, 351, 353, 358, 362, 368, 372, 375, 377, 378, 379, 384, 386, 387, 392, 395, 396, 397, 398, 399, 400, 401, 402, 403], "sum": [1, 3, 12, 95, 138, 148, 160, 218, 236, 264, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 397, 399], "vector": [1, 3, 6, 138, 145, 148, 232, 245, 246, 274, 340, 400], "element": [1, 11, 12, 17, 18, 19, 20, 21, 22, 25, 66, 82, 90, 91, 92, 93, 94, 95, 99, 103, 104, 106, 107, 108, 110, 112, 113, 131, 132, 135, 136, 139, 140, 141, 142, 143, 146, 147, 152, 153, 154, 155, 156, 157, 158, 159, 163, 165, 176, 178, 179, 181, 186, 188, 189, 202, 203, 206, 214, 215, 216, 217, 221, 222, 228, 232, 234, 235, 238, 243, 247, 271, 272, 273, 276, 279, 284, 306, 310, 312, 334, 336, 337, 352, 353, 355, 358, 359, 360, 395, 396], "wise": [1, 11, 12, 17, 18, 19, 20, 21, 22, 82, 90, 91, 103, 104, 106, 107, 108, 110, 112, 131, 132, 135, 136, 139, 146, 147, 152, 153, 154, 155, 156, 157, 158, 159, 163, 176, 178, 179, 181, 202, 206, 214, 215, 216, 217, 221, 222, 228, 234, 235, 272, 273, 284, 306, 334, 336, 337, 352, 353, 355, 358, 359, 360, 395], "follow": [1, 4, 5, 6, 7, 16, 89, 99, 148, 188, 254, 264, 331, 332, 344, 371, 372, 373, 374, 375, 376, 377, 383, 392, 395, 396, 402], "numpi": [1, 4, 5, 6, 12, 14, 16, 81, 103, 104, 106, 135, 136, 139, 146, 147, 156, 161, 163, 176, 178, 181, 228, 398, 400, 401], "style": [1, 12, 14, 103, 104, 106, 135, 136, 139, 146, 147, 156, 161, 163, 176, 178, 181, 228], "broadcast": [1, 12, 14, 81, 83, 103, 104, 106, 133, 135, 136, 139, 146, 147, 156, 161, 163, 176, 178, 181, 191, 192, 195, 200, 201, 228, 233, 247, 305], "between": [1, 6, 83, 130, 319, 339, 342, 343, 346, 386, 398, 402], "input": [1, 3, 4, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 98, 100, 101, 103, 104, 106, 107, 108, 110, 111, 112, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 134, 135, 136, 138, 139, 140, 141, 142, 143, 145, 146, 147, 148, 149, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 175, 176, 177, 178, 179, 181, 183, 184, 185, 186, 187, 188, 189, 190, 199, 202, 203, 204, 205, 206, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 228, 229, 230, 232, 233, 234, 235, 236, 237, 238, 239, 241, 242, 243, 244, 246, 247, 249, 266, 267, 268, 269, 270, 272, 273, 274, 276, 277, 278, 279, 280, 281, 282, 283, 305, 308, 309, 310, 312, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 333, 338, 339, 341, 342, 343, 344, 346, 347, 349, 351, 362, 365, 395, 396, 397, 400, 401], "upcast": 1, "const": [1, 341], "factor": [1, 149, 320, 340, 385, 388], "streamordevic": 1, "stream": [1, 6, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 65, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 97, 98, 99, 100, 101, 103, 104, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 135, 136, 137, 138, 139, 140, 141, 142, 143, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 195, 196, 197, 199, 200, 201, 202, 203, 204, 205, 206, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 244, 247, 248, 249, 402], "which": [1, 4, 5, 6, 7, 16, 34, 84, 88, 101, 109, 116, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 134, 140, 141, 142, 143, 145, 148, 149, 151, 165, 173, 188, 192, 193, 203, 204, 207, 208, 209, 210, 211, 223, 224, 232, 243, 245, 246, 250, 267, 272, 273, 275, 283, 285, 289, 312, 340, 343, 347, 350, 365, 378, 379, 392, 395, 396, 397, 398, 402, 403], "schedul": [1, 172, 370, 384, 385, 386, 387, 388, 390, 402], "simplest": [1, 264], "wai": [1, 4, 7, 264, 320, 395, 396, 397], "term": [1, 341, 371, 372, 373, 374, 375, 376, 382], "exist": [1, 2, 4, 290, 302], "auto": [1, 7], "ax": [1, 13, 15, 23, 24, 74, 111, 119, 120, 122, 123, 125, 126, 128, 129, 130, 138, 148, 160, 162, 164, 175, 185, 187, 218, 223, 225, 229, 230, 236, 239, 244, 396], "multipli": [1, 35, 188, 189, 271, 316, 320], "themselv": [1, 395], "contain": [1, 4, 25, 26, 64, 84, 101, 124, 125, 126, 148, 157, 158, 159, 188, 220, 247, 264, 289, 291, 292, 298, 319, 347, 365, 368, 395, 396], "act": [1, 346], "data": [1, 5, 6, 9, 16, 113, 127, 128, 133, 137, 150, 182, 200, 240, 248, 273, 321, 322, 323, 324, 325, 326, 327, 328, 395, 397, 399], "nor": [1, 134, 243], "rather": [1, 396, 402], "easi": [1, 264], "interfac": 1, "block": [1, 4, 80, 319], "A": [1, 4, 6, 7, 8, 64, 76, 84, 114, 115, 117, 134, 145, 148, 149, 151, 160, 161, 162, 175, 188, 191, 192, 193, 195, 196, 197, 200, 201, 220, 224, 227, 243, 245, 246, 250, 251, 252, 253, 254, 255, 256, 264, 268, 272, 276, 277, 278, 280, 289, 293, 294, 297, 303, 304, 309, 314, 316, 319, 322, 323, 325, 332, 351, 352, 368, 370, 374, 376, 378, 379, 381, 386, 395, 396, 398, 399], "part": [1, 396, 397], "creat": [1, 4, 7, 113, 137, 227, 264, 368, 370, 386, 395, 397, 399], "output": [1, 4, 7, 13, 14, 15, 16, 25, 80, 81, 84, 92, 93, 94, 95, 113, 114, 115, 116, 117, 124, 127, 128, 129, 133, 134, 137, 139, 148, 150, 160, 162, 164, 165, 175, 182, 183, 186, 187, 191, 192, 193, 195, 196, 197, 200, 201, 210, 211, 218, 223, 225, 229, 233, 240, 243, 244, 245, 246, 247, 248, 249, 266, 267, 268, 269, 270, 278, 281, 282, 283, 305, 308, 318, 319, 320, 322, 323, 324, 325, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 362, 365, 395, 396, 397, 398, 399, 400, 401, 402], "given": [1, 13, 15, 25, 35, 81, 83, 85, 92, 93, 94, 95, 99, 101, 109, 111, 118, 119, 120, 121, 122, 123, 127, 128, 129, 133, 148, 160, 162, 164, 171, 175, 180, 187, 195, 197, 205, 213, 218, 220, 225, 229, 231, 237, 238, 240, 241, 242, 244, 256, 266, 267, 271, 282, 283, 289, 305, 339, 341, 347], "further": [1, 7, 396], "ha": [1, 2, 4, 5, 6, 73, 84, 101, 124, 125, 127, 128, 129, 134, 165, 168, 192, 268, 276, 279, 281, 310, 368, 370, 395, 397, 398, 400, 402], "method": [1, 4, 8, 9, 10, 27, 256, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 296, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 368, 371, 372, 373, 374, 375, 376, 377, 379, 382, 383, 390], "run": [1, 2, 4, 5, 6, 7, 8, 184, 256, 268, 285, 371, 372, 374, 375, 376, 395, 398, 402, 403], "our": [1, 4, 5, 314, 371, 372, 373, 374, 376, 377], "concret": [1, 276, 279, 281, 310, 398, 402], "class": [1, 4, 5, 8, 9, 10, 27, 256, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 368, 371, 372, 373, 374, 375, 376, 377, 382, 383, 390], "public": [1, 264], "explicit": [1, 379, 392, 399], "alpha_": 1, "beta_": 1, "must": [1, 2, 7, 80, 83, 133, 148, 191, 192, 195, 197, 200, 201, 247, 320, 399], "know": [1, 4], "itself": [1, 250, 379], "popul": 1, "To": [1, 2, 3, 4, 5, 7, 171, 264, 365, 395, 396, 400], "avoid": [1, 297, 395], "unnecessari": [1, 4], "alloc": [1, 168, 171, 172, 368], "respons": 1, "space": [1, 150, 349], "void": 1, "eval_cpu": 1, "std": [1, 327], "overrid": [1, 105], "eval_gpu": 1, "jacobian": [1, 145, 245, 400], "product": [1, 94, 138, 145, 161, 184, 187, 236, 245, 305, 400], "primal": [1, 145, 245], "tangent": [1, 21, 22, 145, 234, 235, 363], "int": [1, 4, 5, 8, 13, 15, 16, 23, 24, 25, 26, 30, 31, 32, 33, 37, 38, 39, 40, 41, 42, 45, 52, 53, 54, 55, 56, 59, 62, 64, 67, 70, 71, 72, 73, 75, 80, 81, 85, 86, 87, 88, 92, 93, 94, 95, 99, 100, 101, 111, 113, 116, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 133, 134, 137, 144, 148, 150, 160, 162, 164, 167, 168, 169, 171, 172, 175, 177, 182, 185, 186, 187, 188, 189, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 203, 204, 205, 218, 219, 220, 223, 224, 225, 229, 230, 232, 233, 236, 237, 238, 239, 240, 241, 242, 243, 244, 246, 248, 250, 256, 264, 266, 267, 268, 269, 270, 274, 276, 277, 278, 279, 280, 281, 282, 283, 305, 307, 308, 309, 310, 312, 316, 319, 333, 339, 340, 344, 349, 351, 368, 384, 386, 387, 388], "argnum": [1, 134, 243, 396], "cotan": 1, "across": [1, 277], "pair": [1, 185, 292, 312], "repres": [1, 4, 347, 351, 399], "axi": [1, 4, 5, 13, 15, 23, 24, 25, 26, 30, 31, 32, 33, 37, 38, 39, 40, 52, 53, 54, 55, 59, 67, 70, 71, 75, 85, 92, 93, 94, 95, 101, 111, 114, 115, 118, 121, 124, 125, 126, 127, 128, 129, 130, 148, 160, 162, 164, 175, 177, 185, 186, 187, 192, 203, 218, 219, 220, 223, 224, 225, 229, 230, 232, 233, 237, 238, 239, 244, 246, 266, 267, 282, 283, 310, 333, 337, 339, 340, 344, 349, 351, 359, 397], "correspond": [1, 13, 15, 73, 83, 99, 101, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 160, 162, 175, 187, 229, 236, 246, 253, 396], "dimens": [1, 4, 13, 15, 23, 24, 58, 64, 73, 77, 78, 79, 84, 87, 88, 101, 111, 116, 125, 126, 128, 129, 130, 138, 148, 149, 160, 161, 162, 164, 175, 187, 188, 192, 199, 225, 229, 233, 236, 239, 244, 268, 269, 270, 272, 273, 276, 277, 278, 279, 280, 305, 309, 310, 312, 319, 320, 333, 340, 395, 396], "virtual": 1, "vmap": [1, 396, 398, 400], "print": [1, 3, 4, 5, 7, 252, 253, 254, 255, 264, 392, 395, 396, 397, 398, 399, 400], "ostream": 1, "o": [1, 7, 117, 279], "equival": [1, 28, 61, 74, 104, 132, 232, 275, 304, 306, 308, 311, 313, 315, 317], "check": [1, 7, 76, 144, 170, 292, 396, 397], "bool": [1, 13, 14, 15, 23, 24, 30, 31, 32, 33, 37, 38, 39, 40, 52, 53, 54, 55, 59, 71, 73, 75, 76, 84, 88, 92, 93, 94, 95, 116, 139, 144, 148, 151, 160, 162, 164, 165, 170, 172, 175, 187, 189, 225, 229, 244, 268, 269, 270, 276, 277, 278, 279, 280, 281, 285, 289, 290, 292, 297, 299, 302, 305, 308, 310, 312, 316, 319, 320, 338, 341, 372, 383], "is_equival": 1, "other": [1, 4, 6, 144, 148, 264, 291, 368, 377, 395, 397, 398, 400], "privat": 1, "fall": 1, "eval": [1, 2, 3, 4, 5, 264, 368, 370, 395, 396, 398, 400], "out": [1, 7, 80, 266, 267, 272, 273, 282, 283, 299, 395, 396, 397], "deriv": [1, 396, 398], "from": [1, 4, 5, 6, 98, 99, 101, 125, 126, 128, 129, 133, 148, 151, 161, 165, 169, 171, 183, 188, 190, 191, 192, 193, 194, 197, 200, 210, 223, 226, 228, 232, 233, 238, 247, 249, 252, 253, 254, 255, 264, 281, 290, 292, 305, 322, 323, 324, 325, 327, 328, 341, 350, 365, 394, 395, 396, 398, 399, 400, 401, 402], "base": [1, 116, 148, 153, 155, 312, 319, 368, 370, 376, 390, 392, 395, 397], "treat": [1, 125, 126, 128, 129, 232, 320, 395], "paramet": [1, 3, 4, 5, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 34, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 98, 99, 100, 101, 103, 104, 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, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 171, 172, 173, 175, 176, 177, 178, 179, 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, 208, 209, 210, 211, 213, 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, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 285, 286, 289, 290, 292, 297, 298, 299, 302, 303, 304, 305, 306, 307, 308, 309, 310, 312, 314, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 333, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 362, 364, 365, 368, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 381, 382, 383, 384, 385, 386, 387, 388, 390, 395, 396, 398], "produc": [1, 84, 305, 365], "also": [1, 4, 5, 6, 7, 10, 12, 102, 103, 104, 106, 120, 123, 126, 129, 135, 136, 146, 147, 156, 163, 176, 178, 181, 188, 228, 250, 251, 264, 289, 303, 305, 307, 308, 315, 330, 356, 358, 364, 370, 395, 396, 397, 398, 399, 400, 403], "new": [1, 5, 81, 101, 177, 180, 204, 224, 239, 253, 254, 297, 305, 368, 370, 381, 386, 395, 397, 398, 399], "construct": [1, 5, 41, 100, 133, 182, 237, 248], "its": [1, 7, 161, 186, 199, 240, 251, 255, 264, 308, 374, 375, 376, 399, 402], "type": [1, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 34, 64, 73, 76, 77, 78, 79, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 98, 99, 100, 101, 103, 104, 106, 107, 108, 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, 171, 172, 175, 176, 177, 178, 179, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 199, 200, 201, 202, 203, 204, 205, 206, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 228, 229, 230, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 252, 264, 297, 319, 321, 322, 323, 324, 325, 326, 327, 328, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 395, 397], "shape": [1, 2, 4, 5, 61, 76, 80, 81, 84, 86, 87, 88, 101, 117, 118, 121, 124, 127, 128, 129, 133, 145, 161, 182, 183, 191, 192, 193, 195, 196, 197, 200, 201, 204, 233, 245, 247, 248, 249, 264, 266, 267, 268, 269, 270, 272, 273, 276, 278, 279, 281, 282, 283, 292, 310, 321, 322, 323, 324, 325, 326, 327, 328, 340, 351, 370, 395, 396, 397, 400, 402], "pass": [1, 4, 5, 61, 74, 184, 185, 243, 251, 252, 253, 254, 264, 290, 302, 303, 304, 314, 395, 398], "reimplement": 1, "now": [1, 4, 7, 308, 395, 399], "promot": 1, "dtype": [1, 4, 10, 16, 27, 34, 35, 73, 113, 130, 133, 137, 144, 148, 149, 150, 182, 193, 195, 196, 197, 200, 201, 240, 248, 258, 297, 320, 321, 322, 323, 324, 325, 326, 327, 328, 338, 340, 347, 384, 385, 386, 387, 388, 395, 396, 397, 399, 400, 401], "promoted_dtyp": 1, "promote_typ": 1, "float32": [1, 10, 16, 113, 117, 137, 144, 148, 149, 150, 182, 193, 195, 196, 200, 201, 240, 248, 258, 320, 321, 322, 323, 324, 325, 326, 327, 328, 338, 340, 347, 384, 385, 386, 387, 388, 395, 396, 397, 398, 399, 400, 401], "non": [1, 7, 165, 300, 310, 352, 368], "point": [1, 3, 4, 7, 132, 189, 258], "out_dtyp": 1, "is_floating_point": 1, "cast": [1, 34, 127, 128, 129, 151, 285, 297, 399], "up": [1, 4, 395], "determin": [1, 101, 195, 258, 296, 401], "same": [1, 4, 7, 14, 35, 76, 81, 84, 87, 88, 89, 114, 115, 124, 127, 128, 129, 134, 139, 145, 185, 192, 205, 245, 247, 254, 264, 267, 268, 271, 277, 278, 283, 307, 321, 322, 323, 324, 325, 326, 327, 328, 340, 351, 368, 378, 392, 395, 397, 402], "x_cast": 1, "astyp": [1, 4, 285, 399], "y_cast": 1, "broadcasted_input": 1, "broadcast_arrai": 1, "out_shap": 1, "0": [1, 3, 4, 5, 7, 8, 16, 35, 41, 42, 45, 62, 67, 75, 85, 86, 87, 88, 100, 101, 113, 117, 130, 134, 148, 149, 166, 171, 185, 191, 196, 201, 203, 205, 220, 224, 225, 240, 241, 242, 243, 244, 246, 252, 254, 264, 266, 267, 268, 269, 270, 271, 272, 273, 275, 277, 278, 280, 282, 283, 306, 311, 312, 316, 317, 318, 319, 321, 322, 323, 324, 325, 326, 327, 328, 329, 331, 332, 334, 335, 338, 340, 342, 343, 347, 350, 351, 353, 354, 355, 356, 361, 362, 365, 368, 371, 372, 374, 375, 376, 377, 379, 382, 383, 384, 385, 386, 387, 388, 392, 395, 396, 397, 398, 399, 400, 401], "unique_ptr": 1, "make_shar": 1, "to_stream": 1, "handl": [1, 264, 395], "resolv": 1, "No": [1, 4], "happen": [1, 4, 114, 319, 370, 395, 398], "call": [1, 2, 4, 5, 28, 132, 166, 264, 274, 290, 302, 307, 314, 368, 370, 379, 395, 396, 398], "alon": [1, 399], "onli": [1, 4, 6, 7, 76, 80, 86, 87, 88, 148, 188, 195, 264, 289, 290, 292, 297, 299, 302, 303, 304, 368, 395, 396, 401, 402], "execut": [1, 7, 77, 78, 79, 169, 399, 402], "depend": [1, 2, 3, 73, 148, 276, 279, 310, 397, 401, 402], "devic": [1, 6, 7, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 65, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 103, 104, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 135, 136, 137, 138, 139, 140, 141, 142, 143, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 172, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 195, 196, 197, 199, 200, 201, 202, 203, 204, 205, 206, 212, 213, 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, 244, 247, 248, 249, 256, 402, 403], "specifi": [1, 16, 34, 87, 88, 101, 125, 126, 133, 134, 148, 150, 177, 182, 192, 203, 230, 232, 233, 236, 239, 243, 246, 248, 268, 318, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 362, 396, 402], "user": [1, 4, 264], "memori": [1, 6, 166, 167, 168, 169, 171, 172, 319, 368, 372, 395, 398, 399], "been": [1, 4, 168, 398], "naiv": [1, 396], "gener": [1, 2, 3, 10, 16, 88, 113, 125, 126, 150, 165, 191, 195, 196, 197, 200, 201, 319, 392, 395, 397, 398, 403], "version": [1, 7, 99, 156, 160, 188, 218, 246, 392, 396, 397], "declar": 1, "member": [1, 264, 295, 300], "earlier": 1, "over": [1, 4, 5, 13, 15, 23, 24, 25, 26, 86, 87, 88, 92, 93, 94, 95, 120, 123, 126, 129, 138, 148, 150, 160, 162, 164, 175, 186, 187, 206, 218, 219, 225, 229, 236, 238, 244, 268, 269, 270, 277, 280, 309, 340, 384, 387, 396], "each": [1, 64, 99, 109, 116, 144, 161, 165, 185, 188, 189, 192, 203, 210, 211, 220, 237, 239, 246, 247, 272, 273, 274, 276, 277, 279, 310, 312, 319, 338, 340, 392, 395, 398], "find": [1, 3, 7], "captur": [1, 2, 84, 173, 174, 264, 395], "templat": 1, "axpby_impl": 1, "typenam": 1, "t": [1, 4, 107, 117, 189, 243, 264, 266, 276, 279, 282, 310, 371, 372, 373, 374, 375, 376, 377, 382, 383, 395, 396, 402], "readi": 1, "fill": [1, 133, 183, 240, 249, 321, 322, 323, 324, 325, 327, 328], "malloc_or_wait": 1, "synchron": [1, 395], "avail": [1, 3, 4, 5, 7, 9, 170, 402], "There": [1, 264, 320, 395], "wait": [1, 4, 172], "here": [1, 4, 395, 396, 398, 401, 402], "request": 1, "under": [1, 148], "pressur": 1, "condit": [1, 247, 402], "set_data": 1, "nbyte": 1, "collect": [1, 253, 254, 394], "pointer": 1, "x_ptr": 1, "y_ptr": 1, "out_ptr": 1, "relev": 1, "static_cast": 1, "size_t": 1, "out_idx": 1, "size": [1, 4, 5, 47, 64, 80, 87, 99, 111, 114, 115, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 133, 137, 144, 148, 168, 172, 188, 189, 192, 204, 220, 223, 250, 264, 266, 267, 269, 270, 274, 278, 282, 283, 307, 308, 320, 372, 398, 399], "map": [1, 5, 35, 151, 253, 274, 285], "linear": [1, 4, 5, 6, 250, 253, 264, 275, 292, 308, 310, 311, 313, 315, 320, 329, 330, 331, 332, 333, 335, 354, 355, 356, 358, 365, 368, 379, 387, 395], "indic": [1, 14, 23, 24, 25, 26, 35, 134, 139, 140, 141, 142, 143, 220, 232, 233, 243, 299, 301, 340, 347, 386, 397], "offset": [1, 4, 42, 101, 114, 116], "x_offset": 1, "elem_to_loc": 1, "stride": [1, 86, 87, 88, 266, 267, 269, 270, 282, 283, 312, 397], "y_offset": 1, "contigu": 1, "regularli": 1, "default": [1, 7, 13, 14, 15, 16, 23, 24, 25, 26, 76, 80, 84, 85, 86, 87, 88, 96, 97, 99, 100, 101, 113, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 134, 137, 139, 148, 149, 150, 151, 160, 162, 164, 165, 171, 172, 175, 182, 186, 187, 188, 189, 191, 192, 193, 195, 196, 197, 199, 200, 201, 203, 204, 205, 212, 213, 219, 220, 223, 224, 225, 227, 229, 231, 236, 238, 239, 240, 241, 242, 243, 244, 246, 248, 250, 258, 266, 267, 268, 269, 270, 276, 278, 279, 281, 282, 283, 285, 290, 292, 297, 299, 302, 305, 306, 307, 308, 310, 312, 316, 317, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 333, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 368, 371, 372, 373, 374, 375, 376, 377, 382, 383, 384, 392, 394, 395, 396, 399, 401, 403], "row": [1, 113, 137, 188, 240], "major": 1, "henc": [1, 188, 395], "doesn": [1, 264], "addit": [1, 4, 12, 114, 115, 117, 151, 268, 277, 280, 305, 309, 368, 396], "should": [1, 3, 4, 5, 7, 101, 114, 115, 117, 145, 166, 173, 188, 233, 243, 245, 250, 252, 264, 269, 270, 272, 273, 299, 305, 314, 340, 342, 347, 368, 394, 395, 396, 398, 399, 403], "work": [1, 2, 4, 7, 172, 395, 396, 397, 398], "all": [1, 2, 5, 7, 14, 25, 35, 77, 78, 79, 84, 87, 88, 113, 120, 123, 126, 129, 161, 185, 186, 223, 250, 264, 285, 286, 290, 293, 294, 295, 300, 302, 305, 316, 319, 320, 365, 368, 390, 392, 395, 397, 398, 400, 403], "incom": 1, "accordingli": 1, "dispatch": 1, "float16": [1, 10, 151, 258, 285, 398, 399], "bfloat16": [1, 10, 258, 399], "complex64": [1, 258], "throw": [1, 84], "error": [1, 7, 107, 108, 172, 220, 275, 330, 331, 332, 346, 348, 396, 399], "encount": [1, 396], "unexpect": [1, 16], "1": [1, 2, 4, 5, 16, 25, 26, 35, 42, 45, 86, 87, 88, 100, 101, 112, 117, 118, 119, 121, 122, 124, 125, 126, 127, 128, 129, 130, 138, 144, 148, 149, 161, 165, 172, 184, 186, 188, 192, 195, 196, 201, 214, 219, 232, 238, 243, 254, 258, 264, 266, 267, 268, 269, 270, 271, 272, 273, 275, 276, 277, 278, 279, 280, 281, 282, 283, 306, 309, 310, 312, 316, 318, 320, 322, 323, 324, 325, 326, 327, 328, 329, 331, 332, 333, 336, 337, 338, 339, 340, 341, 342, 343, 344, 346, 347, 349, 350, 351, 356, 357, 359, 360, 362, 365, 368, 370, 371, 372, 373, 374, 375, 376, 377, 379, 382, 383, 384, 385, 386, 387, 388, 395, 396, 397, 399, 400, 401, 402], "correct": [1, 7, 374, 375, 376, 397, 398], "els": [1, 4, 264, 290, 398], "float16_t": 1, "bfloat16_t": 1, "complex64_t": 1, "runtime_error": 1, "support": [1, 4, 6, 7, 14, 80, 86, 87, 88, 117, 130, 139, 149, 151, 161, 188, 195, 396, 397, 399, 401], "good": [1, 7, 395, 402], "fallback": 1, "routin": 1, "framework": [1, 6], "certain": [1, 299, 395], "case": [1, 4, 120, 123, 124, 126, 127, 128, 129, 130, 149, 161, 204, 223, 267, 272, 283, 318, 350, 356, 361, 362, 378, 379, 395, 396, 400, 401, 402, 403], "doe": [1, 2, 4, 7, 167, 264, 395, 397, 398, 399], "half": [1, 16, 197, 201, 312, 398], "precis": [1, 4, 112, 117, 264, 275, 309, 378, 395], "assum": [1, 4, 80, 149, 253, 264, 266, 267, 277, 282, 283], "have": [1, 4, 7, 14, 76, 77, 78, 79, 80, 125, 126, 128, 129, 139, 161, 173, 192, 252, 279, 305, 314, 377, 379, 394, 395, 397, 398, 402], "fix": [1, 4, 7, 398], "direct": [1, 4, 287, 377, 402], "column": [1, 113, 137, 188], "place": [1, 4, 35, 205, 250, 398, 399], "expect": [1, 4, 269, 270, 271, 272, 273, 316, 319, 341, 395, 397], "write": [1, 4, 264, 399], "copi": [1, 4, 6, 186, 219, 399], "right": [1, 7, 188, 266, 267, 275, 282, 283, 320, 331, 332, 341, 343, 351], "catlas_saxpbi": 1, "axpby_impl_acceler": 1, "first": [1, 2, 3, 4, 5, 7, 101, 130, 134, 157, 159, 161, 186, 199, 230, 236, 243, 252, 254, 264, 267, 277, 283, 320, 339, 347, 372, 374, 375, 376, 379, 395, 396, 399, 402], "special": 1, "copy_inplac": 1, "copytyp": 1, "inplac": 1, "n": [1, 4, 27, 80, 86, 87, 88, 113, 118, 120, 121, 123, 124, 127, 129, 137, 195, 225, 240, 244, 266, 267, 268, 269, 270, 272, 273, 276, 279, 282, 283, 310, 320, 346, 351], "incx": 1, "inci": 1, "For": [1, 4, 7, 35, 117, 144, 148, 188, 255, 264, 268, 272, 285, 290, 299, 302, 308, 312, 316, 320, 322, 323, 324, 325, 365, 392, 395, 396, 397, 398, 399, 400, 401, 402], "fit": [1, 188, 402], "criteria": 1, "With": 1, "mind": [1, 4], "finish": 1, "assert": 1, "2": [1, 3, 4, 5, 35, 87, 100, 101, 107, 119, 122, 124, 125, 126, 127, 128, 129, 130, 144, 148, 149, 155, 161, 188, 195, 199, 236, 240, 241, 242, 258, 264, 266, 267, 270, 275, 282, 283, 309, 316, 320, 321, 322, 323, 324, 325, 326, 327, 328, 331, 340, 341, 343, 350, 351, 365, 368, 371, 373, 374, 375, 379, 382, 395, 396, 397, 398, 399, 400, 401, 402], "singl": [1, 5, 109, 145, 151, 165, 185, 245, 267, 283, 395, 397, 401], "flag": [1, 395, 399], "row_contigu": 1, "col_contigu": 1, "common": [1, 370, 395, 398], "just": [1, 5, 280, 395, 397], "much": [1, 4, 266, 267, 282, 283, 395, 398], "enough": [1, 398], "If": [1, 4, 7, 13, 14, 15, 16, 23, 24, 25, 26, 73, 76, 83, 85, 89, 92, 93, 94, 95, 100, 101, 109, 114, 116, 127, 128, 129, 132, 133, 134, 139, 148, 151, 160, 161, 162, 164, 165, 171, 172, 175, 182, 185, 186, 187, 192, 195, 203, 218, 219, 220, 225, 229, 231, 232, 233, 236, 238, 243, 244, 246, 248, 250, 253, 268, 269, 270, 277, 280, 281, 290, 292, 302, 308, 310, 312, 314, 316, 320, 338, 340, 351, 372, 395, 396, 398, 401, 402, 403], "plan": [1, 395], "stop": [1, 4, 16, 150, 174, 226, 396, 397], "enjoi": 1, "speed": 1, "appl": [1, 4, 6, 7, 402], "silicon": [1, 4, 6, 7, 402], "address": 1, "shade": 1, "languag": 1, "kernel": [1, 86, 87, 88, 266, 267, 282, 283, 395, 397], "written": 1, "some": [1, 3, 4, 5, 290, 302, 379, 395, 396, 398], "help": [1, 4, 395, 402], "resourc": 1, "walkthrough": 1, "pipelin": 1, "specif": [1, 7, 396], "cpp": 1, "keep": [1, 13, 15, 23, 24, 160, 162, 164, 175, 187, 225, 229, 244, 264, 289, 396, 398], "launch": [1, 397], "exactli": [1, 4, 292, 396], "mani": [1, 220, 269, 270, 274, 307, 395, 398], "thread": 1, "pick": 1, "updat": [1, 3, 4, 5, 35, 84, 250, 253, 268, 285, 286, 292, 297, 298, 299, 304, 370, 372, 375, 377, 378, 379, 383, 384, 385, 386, 387, 388, 395, 398], "assign": [1, 35, 368], "axpby_gener": 1, "buffer": [1, 167, 399], "constant": [1, 4, 7, 114, 115, 185, 264, 268, 277, 280, 309, 341, 351, 382, 384, 395, 399], "3": [1, 4, 7, 130, 144, 148, 149, 275, 320, 323, 325, 331, 334, 372, 377, 392, 395, 397, 399, 400], "4": [1, 4, 99, 130, 148, 188, 189, 210, 250, 258, 266, 267, 268, 278, 282, 283, 307, 308, 319, 320, 322, 323, 324, 338, 395, 397, 400, 402], "5": [1, 3, 4, 7, 148, 172, 191, 266, 268, 271, 272, 273, 275, 278, 282, 317, 320, 321, 324, 325, 331, 350, 361, 365, 382, 384, 385, 395, 396, 397], "x_stride": 1, "6": [1, 4, 148, 210, 319, 323, 331, 332, 334, 341, 351, 355, 382, 395, 397, 400], "y_stride": 1, "7": [1, 4, 148, 188, 397], "ndim": [1, 130, 148, 320], "8": [1, 4, 7, 148, 188, 258, 267, 278, 283, 319, 339, 371, 372, 373, 374, 375, 376, 382, 395, 397, 400, 402], "uint": 1, "index": [1, 6, 8, 25, 35, 111, 113, 134, 165, 186, 232, 233, 243, 256], "thread_position_in_grid": 1, "convert": [1, 73, 77, 78, 79, 98, 130, 190, 307, 308, 398, 399, 400], "instanti": [1, 5, 398], "give": [1, 4, 5, 25, 395], "uniqu": [1, 392], "host": 1, "name": [1, 151, 188, 189, 208, 209, 210, 211, 264, 277, 289, 292, 294, 397, 401], "so": [1, 4, 7, 134, 243, 271, 320, 370, 395, 398, 402], "identifi": [1, 252, 394], "instantiate_axpbi": 1, "type_nam": 1, "host_nam": 1, "axpby_general_": 1, "logic": [1, 157, 158, 159], "set": [1, 4, 5, 7, 84, 102, 105, 114, 116, 171, 172, 212, 213, 227, 275, 280, 281, 288, 290, 297, 298, 299, 302, 303, 308, 312, 318, 339, 351, 362, 368, 372, 379, 392, 396, 398], "grid": [1, 165], "shown": 1, "below": [1, 7, 148, 240, 242, 258, 320, 398], "prepar": [1, 4], "carri": 1, "d": [1, 4, 100, 101, 138, 148, 161, 165, 184, 232, 240, 241, 242, 255, 273, 276, 279, 310, 371, 374, 376, 402], "ostringstream": 1, "kname": 1, "axpby_": 1, "general_": 1, "type_to_nam": 1, "sure": [1, 2, 4, 7, 264, 395], "look": [1, 4], "folder": 1, "register_librari": 1, "mlx_ext": 1, "get_colocated_mtllib_path": 1, "get_kernel": 1, "str": [1, 89, 134, 148, 151, 165, 173, 207, 208, 209, 210, 211, 243, 252, 255, 285, 286, 289, 290, 292, 294, 296, 302, 320, 324, 325, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351], "encod": [1, 116, 312, 316, 319, 340], "compute_encod": 1, "get_command_encod": 1, "setcomputepipelinest": 1, "regist": [1, 5], "those": [1, 4, 264], "nelem": 1, "set_array_buff": 1, "setbyt": 1, "sizeof": 1, "number": [1, 10, 16, 57, 66, 84, 87, 88, 99, 113, 134, 137, 145, 150, 185, 188, 189, 192, 196, 199, 201, 203, 205, 236, 237, 240, 243, 245, 246, 250, 264, 268, 269, 270, 272, 273, 277, 278, 305, 306, 319, 320, 322, 323, 324, 325, 384, 386, 387, 392, 395, 396, 403], "ani": [1, 4, 6, 16, 84, 252, 253, 254, 255, 264, 275, 285, 286, 289, 298, 308, 319, 320, 365, 387, 394, 395, 396, 398, 400, 401, 402], "threadgroup": 1, "higher": [1, 138, 347, 396], "than": [1, 4, 73, 89, 101, 104, 116, 135, 136, 146, 147, 161, 171, 253, 312, 318, 320, 347, 350, 362, 372, 377, 395, 396, 402], "max": [1, 148, 163, 282, 283, 306, 334, 339, 341, 342, 347, 351, 353, 355, 372, 376, 395, 396, 402], "allow": [1, 144, 264, 304, 368, 390, 397, 400], "tgp_size": 1, "min": [1, 148, 176, 306, 334, 353, 355], "maxtotalthreadsperthreadgroup": 1, "3d": [1, 268, 273, 320], "mtl": 1, "group_dim": 1, "grid_dim": 1, "divid": [1, 35, 132, 188], "among": 1, "dispatchthread": 1, "few": [1, 4, 5, 6, 398, 400], "thing": [1, 4], "note": [1, 4, 7, 14, 80, 84, 86, 87, 117, 125, 126, 139, 148, 167, 188, 192, 250, 264, 309, 320, 399, 401], "about": [1, 4, 5, 398, 402], "befor": [1, 4, 7, 25, 186, 289, 319, 379, 397, 398], "move": [1, 177, 402], "track": [1, 264, 268], "activ": [1, 7, 167, 272, 318, 319, 352, 361, 362, 364, 395], "command_buff": 1, "mtlcommandbuff": 1, "associ": [1, 210, 211, 398], "reli": 1, "u": [1, 281, 304, 390, 398], "command": [1, 2, 7], "instead": [1, 7, 264, 304, 316, 396, 398], "one": [1, 4, 7, 35, 73, 77, 83, 87, 88, 111, 113, 114, 115, 148, 154, 161, 189, 192, 223, 228, 258, 302, 320, 340, 402], "end_encod": 1, "until": [1, 398, 400], "limit": [1, 83, 171, 172, 397], "hit": 1, "flush": 1, "next": [1, 4, 5, 171], "These": [1, 84, 233, 340, 402], "built": [1, 7, 398], "top": [1, 238, 281, 320], "includ": [1, 92, 93, 94, 95, 167, 168, 172, 280, 286, 298, 308, 341, 395, 396, 397, 400, 401, 403], "forward": [1, 243, 395, 398], "mode": [1, 89, 288, 299, 301, 320, 324, 325], "diff": 1, "push": 1, "along": [1, 23, 24, 84, 85, 92, 93, 94, 95, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 148, 203, 218, 220, 224, 232, 233, 236, 237, 238, 264, 310, 333], "op": [1, 184, 290, 398], "similarli": [1, 7, 161, 396, 398], "scale_arr": 1, "contribut": 1, "tangent_x": 1, "tangent_i": 1, "cotang": [1, 245], "unus": 1, "revers": [1, 37, 38, 39, 40, 92, 93, 94, 95, 239, 316], "arg": [1, 4, 9, 10, 109, 210, 211], "push_back": 1, "fulli": [1, 6, 395, 399, 402], "overal": 1, "directori": [1, 4, 7], "h": [1, 86, 87, 148, 267, 268, 270, 272, 273, 276, 279, 283, 310, 396, 398], "mlx_sample_extens": 1, "__init__": [1, 4, 5, 8, 9, 10, 27, 256, 264, 368], "py": [1, 4, 7], "cmakelist": 1, "txt": 1, "setup": [1, 3, 5, 7, 395], "packag": [1, 3, 5, 365], "hold": [1, 4, 9, 10, 148, 395], "instal": 1, "nanobind": [1, 7, 319], "sinc": [1, 4, 5, 368, 377, 386, 399, 402], "compon": [1, 4], "etc": [1, 188, 264, 320], "alreadi": [1, 2, 4], "nb_modul": 1, "_ext": 1, "m": [1, 4, 7, 80, 113, 148, 240, 266, 267, 282, 283, 371, 395], "doc": [1, 5], "sampl": [1, 3, 4, 150, 191, 192, 193, 195, 197, 200, 201, 322, 323, 324, 325, 327, 328, 341, 347, 351, 392, 395], "_a": 1, "nb": 1, "kw_onli": 1, "none": [1, 4, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 65, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 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, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 173, 174, 175, 176, 177, 178, 179, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 209, 210, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 246, 247, 248, 249, 250, 252, 253, 254, 256, 266, 267, 275, 282, 283, 285, 289, 290, 297, 302, 305, 310, 316, 319, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 372, 390, 397], "r": [1, 4, 149, 243, 272, 276], "most": [1, 192, 264, 381, 395, 396, 397, 398], "complex": [1, 125, 126, 127, 128, 129, 252, 258, 264, 304, 395, 396], "abov": [1, 4, 188, 241, 264, 320, 375, 396, 397, 398, 402], "come": [1, 4, 396], "bell": 1, "whistl": 1, "liter": [1, 320, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351], "string": [1, 399, 401], "modul": [1, 4, 5, 250, 251, 314, 319, 365, 381, 394, 395, 398], "ensur": [1, 7, 346], "caster": 1, "requir": [1, 4, 264, 398, 399], "find_packag": 1, "config": 1, "link": [1, 7], "your": [1, 4, 7, 368, 396, 398], "add_librari": 1, "sourc": [1, 2, 56, 177, 239], "target_sourc": 1, "cmake_current_list_dir": 1, "header": 1, "target_include_directori": 1, "target_link_librari": 1, "attach": 1, "conveni": [1, 5, 144], "mlx_build_metallib": 1, "metallib": [1, 7], "target": [1, 243, 338, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 395], "destin": [1, 56, 177], "automat": [1, 6, 151, 400, 401, 402], "what": [1, 4, 253], "practic": [1, 395], "mlx_build_met": [1, 7], "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, "final": [1, 3, 4, 5, 387], "nanobind_add_modul": 1, "nb_static": 1, "stable_abi": 1, "lto": 1, "nomins": 1, "nb_domain": 1, "build_shared_lib": 1, "target_link_opt": 1, "wl": 1, "rpath": 1, "loader_path": 1, "onc": [1, 395], "describ": [1, 398], "util": [1, 4, 6, 7, 210, 264], "__name__": [1, 4], "__main__": [1, 4], "descript": [1, 4, 258], "ext_modul": 1, "cmakeextens": 1, "cmdclass": 1, "build_ext": 1, "cmakebuild": 1, "package_data": 1, "dylib": 1, "extras_requir": 1, "dev": [1, 7], "zip_saf": 1, "fals": [1, 4, 13, 14, 15, 23, 24, 30, 31, 32, 33, 37, 38, 39, 40, 52, 53, 54, 55, 59, 71, 75, 76, 84, 88, 92, 93, 94, 95, 139, 144, 148, 151, 160, 162, 164, 165, 172, 175, 187, 225, 229, 244, 247, 250, 252, 253, 254, 258, 277, 278, 280, 281, 290, 292, 302, 305, 308, 312, 316, 319, 320, 338, 341, 372, 383, 399], "python_requir": 1, "even": [1, 4, 84, 395, 398, 399], "though": [1, 4, 395, 398, 399], "co": [1, 316, 396], "locat": [1, 303, 304, 402], "pip": [1, 7], "j8": 1, "libmlx_ext": 1, "cpython": 1, "3x": 1, "darwin": 1, "try": [1, 7], "after": [1, 4, 5, 25, 130, 132, 166, 186, 188, 268, 277, 280, 285, 286, 290, 292, 299, 302, 303, 304, 305, 319, 350, 395, 402], "abl": [1, 188], "simpli": [1, 4, 7, 311, 329, 335, 354, 363, 368, 395, 396], "plai": [1, 4], "ones": [1, 4, 183, 210, 240, 303, 304, 397], "b": [1, 2, 4, 12, 14, 76, 80, 103, 104, 106, 132, 135, 136, 138, 139, 146, 147, 148, 156, 157, 159, 161, 163, 176, 178, 181, 184, 188, 228, 236, 243, 254, 281, 310, 320, 333, 396, 397, 398, 399, 400, 401, 402], "f": [1, 3, 5, 148, 264, 279, 375, 395, 399], "item": [1, 3, 4, 5, 253, 398, 399, 400], "true": [1, 3, 4, 14, 37, 38, 39, 40, 76, 84, 92, 93, 94, 95, 116, 139, 144, 148, 151, 165, 172, 189, 218, 247, 250, 252, 253, 254, 258, 264, 268, 269, 270, 276, 277, 278, 279, 280, 281, 289, 290, 292, 299, 302, 308, 310, 312, 316, 319, 320, 338, 346, 372], "quick": [1, 6], "benchmark": [1, 395], "see": [1, 4, 5, 7, 9, 10, 29, 30, 31, 32, 33, 36, 37, 38, 39, 40, 42, 44, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 65, 67, 68, 69, 70, 71, 72, 74, 75, 148, 171, 208, 209, 250, 258, 264, 268, 272, 275, 288, 306, 307, 308, 311, 312, 313, 315, 316, 317, 320, 322, 323, 324, 325, 330, 331, 332, 356, 395, 396, 397, 400, 402], "compar": [1, 76, 395], "time": [1, 4, 7, 172, 237, 264, 266, 267, 276, 279, 282, 283, 310, 395, 396, 398, 402], "set_default_devic": 1, "256": [1, 5], "512": [1, 2, 4, 319, 402], "random": [1, 2, 3, 4, 5, 6, 266, 267, 268, 278, 282, 283, 292, 299, 395, 396, 402, 403], "normal": [1, 3, 4, 114, 115, 195, 200, 264, 266, 267, 268, 277, 278, 280, 282, 283, 309, 319, 322, 324, 399, 402], "bench": 1, "warm": [1, 395], "rang": [1, 2, 3, 4, 5, 7, 16, 130, 150, 323, 325, 331, 332, 370, 384, 385, 386, 387, 388, 392, 395, 396, 398, 402], "100": [1, 3, 4, 387, 395, 396, 398, 402], "5000": 1, "e": [1, 5, 7, 107, 145, 214, 268, 269, 270, 272, 273, 277, 278, 280, 290, 309, 336, 337, 359, 364, 370, 373, 395, 398, 403], "simple_tim": 1, "custom_tim": 1, "3f": [1, 5, 395], "114": 1, "109": 1, "modest": 1, "improv": [1, 2, 4, 371, 372, 373, 374, 375, 376, 382, 395], "awai": [1, 4], "nn": [1, 4, 5, 210, 253, 264, 365, 368, 370, 379, 381, 395, 398], "grad": [1, 3, 5, 243, 370, 378, 395, 396, 397, 398, 400], "full": [1, 5, 61, 74, 89, 218, 303, 304, 341, 395, 398], "profil": 2, "kei": [2, 4, 117, 191, 192, 193, 195, 196, 197, 199, 200, 201, 252, 253, 289, 290, 302, 305, 379, 392, 394, 396], "step": [2, 4, 5, 16, 264, 276, 279, 310, 372, 379, 384, 386, 387, 388, 395], "optim": [2, 3, 5, 6, 303, 395, 396, 398], "build": [2, 4, 6, 324, 368, 395], "mlx_metal_debug": [2, 7], "option": [2, 4, 13, 15, 16, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 65, 67, 68, 69, 70, 71, 72, 74, 75, 77, 78, 79, 80, 84, 85, 86, 87, 88, 89, 92, 93, 94, 95, 99, 100, 101, 113, 114, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 133, 134, 137, 142, 143, 148, 149, 150, 151, 160, 162, 164, 165, 172, 175, 182, 185, 186, 187, 188, 189, 191, 192, 193, 195, 196, 197, 199, 200, 201, 203, 204, 218, 219, 220, 223, 224, 225, 229, 231, 232, 236, 238, 239, 240, 241, 242, 243, 244, 246, 248, 250, 252, 253, 254, 266, 267, 268, 269, 270, 276, 279, 281, 282, 283, 285, 289, 290, 292, 297, 302, 305, 307, 308, 310, 312, 316, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 371, 372, 373, 374, 375, 376, 377, 379, 382, 383, 384, 392, 395, 401, 403], "debug": 2, "record": [2, 169, 398], "dure": [2, 84, 271, 272, 273, 320, 399], "compil": [2, 6, 7, 102, 105, 396, 398], "later": [2, 7], "inspect": [2, 395, 400], "label": [2, 3, 340, 347], "object": [2, 9, 27, 46, 73, 84, 144, 210, 246, 252, 253, 254, 258, 272, 319, 394], "queue": 2, "readabl": 2, "enabl": [2, 4, 7, 84, 105, 383], "python": [2, 4, 46, 64, 73, 109, 252, 253, 254, 255, 368, 378, 379, 381, 394, 396, 399], "prepend": [2, 161], "cmake_arg": 2, "dmlx_metal_debug": 2, "ON": [2, 7], "start_captur": 2, "initi": [2, 3, 4, 264, 268, 277, 278, 280, 281, 306, 309, 321, 322, 323, 324, 325, 326, 327, 328, 368, 379, 384, 385, 387, 388, 395, 398], "gpu": [2, 6, 395, 397, 402], "trace": [2, 395], "applic": [2, 7], "mtl_capture_en": 2, "uniform": [2, 264, 281, 292, 323, 325, 365, 392, 395, 396, 402], "trace_fil": 2, "mlx_trace": 2, "gputrac": [2, 173], "path": [2, 7, 173, 210, 211, 250, 254, 292], "_": [2, 3, 4, 254, 264, 384, 385, 386, 387, 388, 392, 395, 398, 402], "10": [2, 4, 5, 153, 205, 210, 253, 264, 292, 365, 386, 388, 395, 397], "stop_captur": 2, "open": [2, 7, 16, 197, 201], "replai": 2, "view": [2, 399], "great": 2, "overview": 2, "oper": [2, 4, 6, 8, 34, 77, 78, 79, 88, 117, 218, 226, 233, 256, 264, 319, 377, 395, 396, 397, 398, 399, 400, 402, 403], "checkout": [2, 395], "document": [2, 6, 61, 74, 208, 209, 258, 395, 396, 397], "inform": [2, 4, 5, 7, 208, 209, 258, 264, 268, 275, 305, 396, 402], "skip": 2, "save": [2, 4, 6, 151, 173, 188, 208, 209, 210, 211, 296, 398], "within": [2, 25, 139], "project": [2, 4, 305], "us": [2, 3, 4, 5, 6, 7, 16, 35, 99, 102, 104, 116, 130, 148, 149, 161, 167, 168, 169, 171, 188, 189, 203, 204, 231, 252, 258, 264, 267, 272, 274, 275, 276, 279, 281, 283, 285, 289, 296, 303, 305, 307, 308, 310, 312, 316, 319, 320, 324, 325, 331, 332, 339, 365, 368, 370, 371, 372, 374, 375, 376, 377, 378, 379, 392, 394, 395, 396, 397, 400, 402], "cmake": [2, 7], "mkdir": [2, 7], "cd": [2, 7], "g": [2, 7, 148, 188, 279, 364, 382, 383, 398, 403], "xcodeproj": 2, "select": [2, 7, 238, 247, 285, 289, 297], "metal_captur": 2, "exampl": [2, 3, 4, 5, 16, 35, 130, 148, 149, 227, 232, 254, 264, 266, 267, 268, 278, 282, 283, 290, 292, 299, 302, 320, 321, 322, 323, 324, 325, 326, 327, 328, 338, 340, 347, 365, 370, 379, 384, 385, 386, 387, 388, 392, 396, 397, 398, 399, 400, 401], "schema": 2, "implement": [3, 5, 116, 117, 148, 274, 289, 305, 312, 314, 316, 318, 319, 320, 362, 371, 372, 373, 374, 376, 377, 378, 390, 395, 396, 399], "basic": [3, 205, 396], "model": [3, 5, 6, 210, 250, 251, 253, 254, 264, 285, 288, 290, 292, 296, 299, 301, 302, 303, 305, 319, 365, 368, 370, 378, 379, 381, 395, 398], "learn": [3, 5, 6, 268, 277, 278, 280, 306, 309, 371, 372, 373, 374, 375, 376, 377, 382, 383], "problem": [3, 5, 264], "metadata": [3, 151, 208, 209], "num_featur": [3, 268], "num_exampl": 3, "1_000": 3, "num_it": 3, "10_000": 3, "iter": [3, 5, 253, 254, 392, 395, 398], "sgd": [3, 5, 370, 377, 379, 384, 385, 388, 395], "lr": [3, 377], "01": [3, 335, 375], "rate": [3, 371, 372, 373, 374, 375, 376, 377, 382, 383], "ll": [3, 5, 343, 395, 396], "synthet": 3, "dataset": [3, 398], "design": [3, 6, 392, 402], "matrix": [3, 41, 80, 99, 100, 113, 137, 148, 149, 161, 165, 188, 189, 195, 307, 308, 326, 365], "ground": [3, 4, 340, 350], "truth": [3, 340, 350], "w_star": 3, "valu": [3, 4, 11, 14, 16, 23, 24, 46, 73, 76, 83, 113, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 133, 139, 148, 150, 185, 191, 192, 193, 195, 196, 197, 200, 201, 208, 232, 233, 243, 246, 251, 252, 253, 254, 258, 267, 271, 272, 273, 278, 281, 283, 289, 305, 306, 317, 318, 319, 321, 338, 339, 340, 341, 342, 343, 345, 346, 347, 348, 349, 350, 362, 368, 372, 375, 384, 385, 387, 388, 396], "gaussian": [3, 275, 330, 331, 332, 341], "nois": 3, "noisi": 3, "ep": [3, 114, 115, 268, 277, 278, 280, 309, 339, 341, 351, 371, 372, 373, 374, 375, 376, 382], "1e": [3, 5, 14, 139, 268, 277, 278, 280, 309, 339, 341, 351, 371, 372, 373, 374, 375, 376, 379, 382, 384, 385, 386, 387, 388], "weight": [3, 86, 87, 88, 114, 115, 253, 264, 292, 296, 307, 308, 338, 340, 368, 372, 375, 377, 379, 383, 396, 398], "squar": [3, 4, 115, 137, 206, 221, 243, 253, 264, 309, 348, 350, 371, 372, 374, 375, 376, 396, 399], "loss": [3, 5, 243, 264, 370, 395, 396, 398], "gradient": [3, 5, 134, 226, 243, 251, 264, 290, 303, 308, 319, 346, 368, 370, 371, 372, 374, 375, 376, 377, 378, 381, 383, 395, 396, 397, 398, 399, 400], "loss_fn": [3, 5, 370, 395, 396], "w": [3, 87, 99, 188, 189, 243, 254, 267, 268, 270, 272, 273, 281, 283, 383, 396], "mean": [3, 4, 5, 115, 195, 196, 243, 264, 268, 277, 290, 309, 327, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 395, 396, 399], "grad_fn": [3, 395, 396], "randomli": [3, 4, 271, 272, 273], "Then": [3, 7], "repeatedli": 3, "verifi": [3, 7], "close": [3, 6, 7, 14, 139], "error_norm": 3, "5f": 3, "someth": [3, 4, 397], "00005": 3, "00364": 3, "complet": [3, 4, 7, 172, 303, 304, 396, 402], "logist": [3, 214, 332, 358], "github": [3, 5, 7, 395], "repo": [3, 5, 7, 395], "effici": [4, 6, 272, 312, 398, 400], "larg": [4, 264, 305, 346, 395, 398], "ish": 4, "transform": [4, 6, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 251, 264, 268, 277, 280, 281, 289, 290, 302, 308, 312, 397], "without": [4, 6, 226, 305, 364, 394, 395, 398, 399, 402], "compromis": 4, "eas": 4, "llama": 4, "famili": 4, "less": [4, 25, 147, 186, 312, 350], "200": [4, 386], "line": [4, 398, 399], "neural": [4, 6, 274, 322, 323, 352, 365, 368, 382], "network": [4, 6, 268, 272, 274, 322, 323, 365, 368, 382], "concis": 4, "architectur": [4, 7, 264, 304, 402], "notabl": [4, 6], "rope": [4, 264], "posit": [4, 25, 101, 116, 130, 134, 143, 177, 186, 195, 243, 253, 264, 269, 270, 305, 312, 316, 341, 351], "cach": [4, 166, 167, 168, 171, 395], "concaten": 4, "llamaattent": 4, "self": [4, 5, 8, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 65, 67, 68, 69, 70, 71, 72, 73, 74, 75, 256, 264, 352, 368], "dim": [4, 116, 117, 274, 277, 278, 280, 305, 307, 309, 312, 316, 319], "num_head": [4, 305, 319], "super": [4, 5, 264, 368], "tradit": [4, 116, 272, 273, 312], "query_proj": 4, "bia": [4, 99, 114, 188, 189, 253, 264, 269, 270, 276, 279, 280, 281, 290, 292, 302, 305, 308, 310, 374, 375, 376, 379, 396], "key_proj": 4, "value_proj": 4, "out_proj": [4, 368], "__call__": [4, 5, 264, 368], "queri": [4, 117, 305], "mask": [4, 80, 117, 299, 305, 397], "extract": [4, 41, 100, 101, 264, 289, 368], "l": [4, 5, 264, 266, 268, 269, 276, 279, 282, 310, 350], "reshap": [4, 148, 320, 397], "transpos": [4, 28, 189], "combin": 4, "key_cach": 4, "value_cach": 4, "math": [4, 351, 395], "sqrt": [4, 107, 117, 268, 275, 277, 278, 280, 281, 309, 316, 322, 323, 324, 325, 331, 371, 373, 374, 375, 382, 395], "score": [4, 117, 347], "softmax": [4, 117, 264, 337, 340], "values_hat": 4, "possibli": [4, 80, 161], "rm": [4, 7, 115, 372], "swiglu": 4, "rmsnorm": [4, 264], "llamaencoderlay": 4, "mlp_dim": [4, 319], "norm1": 4, "norm2": 4, "linear1": 4, "linear2": 4, "linear3": 4, "sigmoid": [4, 264, 315, 332, 336, 358], "instanc": [4, 35, 188, 255, 264, 278, 285, 286, 287, 290, 292, 293, 294, 299, 302, 303, 304, 314, 368, 399], "embed": [4, 250, 264, 307, 312, 316, 339], "emb": [4, 274, 307, 316], "token": [4, 274, 307], "num_lay": [4, 5, 370], "vocab_s": 4, "norm": [4, 115, 277, 351, 376, 377], "multiheadattent": [4, 264], "create_additive_causal_mask": 4, "list": [4, 9, 13, 15, 27, 67, 73, 77, 78, 79, 81, 84, 85, 88, 109, 119, 120, 122, 123, 125, 126, 128, 129, 133, 134, 145, 148, 160, 162, 164, 165, 175, 182, 185, 187, 191, 192, 193, 195, 196, 197, 200, 201, 208, 218, 220, 224, 225, 229, 236, 237, 239, 243, 244, 245, 248, 252, 255, 264, 290, 292, 293, 294, 295, 300, 302, 303, 304, 368, 374, 375, 376, 377, 386, 394, 395, 396, 398], "still": [4, 7, 148, 395, 398], "consid": [4, 14, 76, 139, 252, 253, 254, 277, 394], "train": [4, 5, 264, 268, 271, 272, 273, 288, 290, 302, 322, 323], "process": [4, 88, 89, 253, 254, 273, 274, 319, 394], "ignor": [4, 35, 83, 84, 109, 372], "whatsoev": 4, "rest": [4, 116, 253, 254, 312], "subsect": 4, "prompt": 4, "autoregress": 4, "yield": [4, 5, 392], "temp": 4, "causal": 4, "append": [4, 161, 395, 398], "store": 4, "per": [4, 5, 99, 188, 189, 250, 268, 277, 278, 280, 309, 390, 395, 398], "care": [4, 398], "last": [4, 26, 73, 114, 115, 120, 123, 125, 126, 128, 129, 130, 138, 149, 161, 192, 219, 236, 269, 270, 272, 273, 277, 320, 399], "logit": [4, 192, 338, 340, 395], "categor": 4, "lazili": [4, 264], "noth": [4, 264, 398], "yet": [4, 148, 264, 368, 379, 396, 397, 398, 400], "forc": [4, 5, 264, 400], "choos": [4, 116, 312], "pars": 4, "feed": 4, "back": [4, 170, 399], "loop": [4, 5, 395, 396, 398], "unsqueez": 4, "sequenc": [4, 13, 15, 30, 31, 52, 53, 54, 55, 59, 67, 70, 71, 75, 81, 88, 111, 119, 120, 122, 123, 125, 126, 128, 129, 133, 160, 162, 164, 175, 182, 187, 191, 192, 193, 195, 196, 197, 200, 201, 204, 218, 220, 223, 225, 229, 236, 237, 239, 244, 248, 268, 269, 276, 279, 310, 319, 392, 402], "length": [4, 223, 268, 269, 276, 279, 310, 386], "len": [4, 120, 123, 126, 129, 386], "overwrit": 4, "discard": [4, 252], "old": 4, "moment": [4, 88, 372, 374, 375, 376], "anymor": 4, "everyth": 4, "small": [4, 112, 114, 115, 268, 277, 280, 309, 341, 346, 351, 395, 402], "12": [4, 386], "8192": 4, "1024": 4, "actual": [4, 16, 292, 368, 398], "materi": [4, 6], "could": [4, 264], "20_000": 4, "machin": [4, 6, 7, 382], "8gb": 4, "ram": 4, "32": [4, 5, 80, 188, 189, 258, 267, 283, 309, 395], "44": 4, "doubl": 4, "bracket": 4, "becaus": [4, 167, 264, 398], "batch": [4, 80, 161, 195, 268, 269, 270, 272, 273, 276, 279, 305, 310, 320, 398], "zip": [4, 5], "haven": 4, "anyth": [4, 243, 398], "result": [4, 16, 35, 73, 84, 99, 114, 115, 138, 148, 151, 161, 184, 189, 195, 203, 205, 224, 236, 237, 247, 253, 254, 316, 395, 396, 399], "veri": [4, 305, 398, 402], "similar": [4, 144, 253, 303, 304, 305, 339, 399, 401], "runtim": [4, 395], "section": [4, 7, 220, 351, 395, 396], "access": [4, 46, 264, 368, 379, 398, 402], "origin": [4, 101, 268, 298, 322, 323, 324, 325, 371, 372, 373, 374, 376, 377, 399], "sentencepiec": 4, "pytorch": [4, 6, 277, 396], "compat": [4, 192, 195, 401], "npz": [4, 151, 210, 211, 292, 296, 401], "file": [4, 7, 151, 207, 208, 209, 210, 211, 292, 296, 396, 401], "argpars": 4, "itertool": [4, 253], "starmap": [4, 253], "np": [4, 5, 399, 400], "torch": [4, 399], "map_torch_to_mlx": 4, "tok_embed": 4, "elif": 4, "replac": [4, 303, 304, 319, 350], "attention_norm": 4, "ffn_norm": 4, "wq": 4, "wk": 4, "wv": 4, "wo": 4, "w1": 4, "w2": 4, "w3": 4, "ffn": 4, "separ": [4, 61, 74, 277, 347], "submodul": [4, 5, 264, 286, 290, 291, 302, 304], "feed_forward": 4, "parser": 4, "argumentpars": 4, "add_argu": 4, "torch_weight": 4, "output_fil": 4, "parse_arg": 4, "state": [4, 5, 264, 276, 279, 310, 370, 379, 392, 395], "savez": [4, 296, 401], "k": [4, 41, 80, 100, 113, 117, 238, 240, 241, 242, 266, 281, 282, 290], "v": [4, 89, 117, 264, 290, 399], "left": [4, 116, 148, 188, 266, 267, 275, 282, 283, 312, 320, 331, 332, 341, 343, 351], "disk": 4, "text": [4, 266, 267, 275, 276, 279, 282, 283, 284, 310, 318, 322, 323, 324, 325, 331, 334, 341, 342, 343, 346, 347, 350, 352, 353, 356, 357, 361, 362, 372, 377], "format": [4, 151, 207, 208, 209, 210, 211, 399], "dictionari": [4, 84, 151, 208, 209, 252, 264, 289, 298, 303, 304, 380, 394, 401], "represent": [4, 188, 252, 255], "tree_unflatten": 4, "helper": [4, 395], "weight_fil": 4, "incur": 4, "sever": [4, 86, 87, 88, 210, 211, 395, 401], "futur": [4, 308, 397, 398], "pth": 4, "current": [4, 6, 7, 80, 86, 87, 88, 168, 188, 264, 372, 398], "around": 4, "m1": [4, 395, 396, 402], "ultra": 4, "7b": 4, "me": 4, "ishmael": 4, "year": 4, "ago": 4, "never": [4, 398], "long": 4, "info": [4, 7], "247": 4, "press": [4, 148], "enter": 4, "littl": 4, "monei": 4, "my": [4, 7], "purs": 4, "greater": [4, 25, 112, 136, 186, 318, 362], "consequ": 4, "walk": 4, "down": 4, "gower": 4, "street": 4, "afternoon": 4, "heavi": 4, "rain": 4, "saw": [4, 396], "off": [4, 7, 398], "man": 4, "rag": 4, "who": 4, "sat": 4, "upon": [4, 253, 254], "hi": [4, 279], "bundl": 4, "hard": 4, "wet": 4, "he": [4, 324, 325], "were": [4, 402], "cry": 4, "watch": [4, 395], "him": 4, "observ": 4, "numer": [4, 114, 115, 148, 156, 160, 218, 268, 277, 278, 280, 309, 339, 341, 351, 371, 372, 373, 374, 375, 376, 382, 395, 398], "crowd": 4, "wa": [4, 398], "hurri": 4, "437": 4, "330": 4, "second": [4, 101, 157, 159, 161, 230, 243, 267, 283, 339, 347, 372, 374, 375, 376, 396, 402], "spent": 4, "amount": [4, 169, 266, 282], "39": 4, "By": [4, 250, 297, 396, 399], "bigger": [4, 372], "well": [4, 264, 290, 302, 305, 398], "remain": [4, 243, 254, 271, 272, 273], "almost": 4, "nobodi": 4, "took": 4, "least": [4, 77, 78, 79, 83, 149, 188], "notic": [4, 396, 401], "distanc": [4, 351], "had": 4, "doubt": 4, "minut": 4, "straight": 4, "slowli": 4, "rais": [4, 148, 172, 220, 292], "ey": 4, "speak": [4, 148], "resum": 4, "postur": 4, "stood": 4, "feel": 4, "pain": 4, "heart": 4, "said": 4, "smile": 4, "face": 4, "am": 4, "someon": 4, "three": [4, 79, 320], "quarter": 4, "hour": 4, "made": 4, "immedi": [4, 285], "repli": 4, "again": [4, 7, 264, 395], "hand": [4, 396, 398], "did": 4, "accustom": 4, "thu": [4, 264], "question": [4, 398], "reason": [4, 397], "tell": [4, 395, 399], "understand": [4, 322, 323], "579": 4, "690": 4, "num": [4, 150, 199], "500": [4, 402], "628": 4, "went": 4, "nervou": 4, "trembl": 4, "told": 4, "why": 4, "And": [4, 320], "surpris": 4, "matter": [4, 264], "shall": 4, "anyhow": 4, "friend": 4, "ye": 4, "slight": [4, 398], "kind": 4, "want": [4, 396, 402], "longer": [4, 89, 396], "soon": 4, "unless": [4, 14, 139, 148, 368], "unlik": [4, 14, 139, 272, 273, 298], "strang": 4, "amus": 4, "That": 4, "secret": 4, "disappoint": 4, "mine": 4, "cannot": [4, 83, 397, 399], "happi": 4, "ask": 4, "shop": 4, "bui": 4, "food": 4, "633": 4, "21": [4, 388], "475": 4, "su": 4, "j": [4, 7, 148, 272, 373, 374, 376], "lu": 4, "pan": 4, "murtadha": 4, "wen": 4, "liu": 4, "2021": 4, "roform": [4, 312], "enhanc": [4, 312, 398], "rotari": [4, 116, 312], "arxiv": [4, 277, 278, 280, 284, 309, 332, 352, 371, 377], "preprint": [4, 371, 377], "2104": 4, "09864": 4, "zhang": 4, "sennrich": 4, "2019": [4, 375], "root": [4, 115, 206, 221, 309], "advanc": [4, 395], "system": [4, 7, 167, 168], "shazeer": 4, "2020": 4, "glu": [4, 264], "variant": [4, 350, 376], "2002": 4, "05202": 4, "classifi": 5, "mnist": 5, "As": [5, 35, 232, 264, 395], "mlp": [5, 264, 319, 370], "inherit": [5, 394], "standard": [5, 46, 73, 161, 193, 196, 225, 319, 322, 324, 327, 400], "idiom": [5, 395], "where": [5, 113, 139, 188, 243, 246, 266, 267, 268, 269, 270, 271, 272, 273, 275, 276, 277, 278, 279, 280, 281, 282, 283, 289, 306, 309, 310, 318, 324, 325, 329, 330, 332, 341, 347, 353, 356, 358, 362, 379, 396, 397], "input_dim": [5, 264, 281, 308], "hidden_dim": [5, 368, 370], "output_dim": [5, 264, 281, 308], "layer_s": 5, "idim": 5, "odim": 5, "maximum": [5, 23, 35, 83, 92, 169, 172, 264, 311, 316, 331, 332, 335, 354, 368, 398], "cross": [5, 88, 338, 340], "entropi": [5, 338, 340], "sub": [5, 101, 199, 250], "commonli": [5, 303, 365, 395], "cross_entropi": [5, 264], "accuraci": 5, "valid": [5, 89, 130, 246, 252, 290, 302, 394], "eval_fn": 5, "argmax": 5, "load": [5, 6, 292], "loader": 5, "num_class": [5, 370], "batch_siz": [5, 370], "num_epoch": [5, 370], "learning_r": [5, 370, 371, 372, 373, 374, 375, 376, 377, 379, 382, 383, 384, 385, 386, 387, 388, 395], "train_imag": [5, 370], "train_label": [5, 370], "test_imag": 5, "test_label": 5, "re": [5, 7, 365], "shuffl": 5, "minibatch": 5, "batch_iter": [5, 370], "perm": 5, "permut": 5, "id": [5, 7], "put": [5, 395], "trainabl": [5, 251, 264, 368], "loss_and_grad_fn": [5, 370, 395, 396], "value_and_grad": [5, 264, 303, 368, 370, 381, 395, 396, 399, 400], "epoch": 5, "test": [5, 7], "confus": 5, "decent": 5, "95": 5, "flexibl": 6, "brought": 6, "research": 6, "except": [6, 113, 124, 125, 127, 128, 129, 277, 292, 397, 399], "featur": [6, 86, 87, 88, 116, 268, 276, 277, 278, 279, 280, 281, 308, 309, 310, 312, 319, 320, 395, 398], "main": [6, 101, 113, 253, 254, 264], "differ": [6, 144, 228, 350, 396], "compos": [6, 264, 395, 396, 400], "lazi": [6, 368, 400], "multi": [6, 117, 269, 270, 397, 399], "cpu": [6, 149, 395, 402], "inspir": 6, "jax": [6, 392], "arrayfir": 6, "unifi": 6, "live": [6, 402], "share": [6, 99, 188, 189], "convers": 6, "regress": [6, 346], "layer": [6, 114, 250, 264, 266, 267, 272, 273, 276, 277, 279, 280, 281, 282, 283, 299, 304, 307, 308, 310, 314, 319, 364, 368], "perceptron": 6, "llm": 6, "infer": [6, 133, 151], "fast": [6, 275, 332, 402], "fft": 6, "algebra": 6, "tree": [6, 84, 109, 134, 243, 246, 252, 253, 254, 255, 378, 379, 381, 390, 396], "develop": [6, 7], "debugg": 6, "pypi": 7, "own": [7, 399], "meet": 7, "seri": 7, "chip": 7, "nativ": 7, "maco": 7, "13": 7, "highli": 7, "recommend": [7, 172, 377], "14": 7, "sonoma": 7, "conda": 7, "forg": 7, "match": [7, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 167, 292, 320, 340, 397, 399], "distribut": [7, 191, 192, 193, 195, 196, 200, 201, 281, 322, 323, 324, 325, 327, 328, 341, 344, 349, 351, 365], "probabl": [7, 197, 271, 272, 273, 308, 338, 340, 344, 402], "platform": 7, "processor": 7, "arm": 7, "i386": 7, "switch": 7, "17": 7, "clang": 7, "24": 7, "xcode": 7, "15": [7, 148, 395], "sdk": 7, "environ": [7, 102, 105], "via": [7, 378, 381, 398, 399], "rosetta": 7, "unam": 7, "p": [7, 191, 264, 271, 272, 273, 351, 374, 376], "clone": 7, "git": 7, "com": 7, "ml": 7, "explor": 7, "http": [7, 277, 278, 280, 284, 309, 332, 352], "wjakob": 7, "2f04eac452a6d9142dedb957701bdb20125561e4": 7, "env": 7, "cmake_build_parallel_level": 7, "edit": [7, 304], "unittest": 7, "discov": 7, "stub": 7, "generate_stub": 7, "either": [7, 12, 61, 73, 74, 83, 103, 104, 106, 132, 135, 136, 146, 147, 148, 156, 161, 163, 176, 178, 181, 228, 243, 267, 283, 314, 320, 324, 325], "static": 7, "libmlx": 7, "preprocessor": 7, "metal_path": 7, "mlx_build_test": 7, "mlx_build_exampl": 7, "mlx_build_benchmark": 7, "mlx_build_python_bind": 7, "multipl": [7, 80, 114, 115, 161, 178, 188, 189, 305, 316, 385, 386, 388, 395, 398, 401], "wish": 7, "variabl": [7, 84, 102, 105, 134, 145, 243, 245, 246], "export": 7, "developer_dir": 7, "app": 7, "content": [7, 289, 395], "xcrun": 7, "macosx": 7, "show": [7, 258, 395], "unabl": 7, "tool": 7, "sudo": 7, "ouptut": 7, "finder": 7, "iterm": 7, "termin": 7, "click": 7, "uncheck": 7, "window": [7, 266, 267, 282, 283], "restart": 7, "grep": 7, "cmake_host_system_processor": 7, "arm64": 7, "x86_64": 7, "wipe": 7, "cahc": 7, "rf": 7, "devicetyp": 8, "attribut": [8, 9, 27, 256, 298, 368, 390], "kwarg": [9, 10, 210, 211, 403], "categori": [10, 258], "bool_": [10, 258], "integ": [10, 132, 144, 148, 185, 188, 189, 191, 197, 220, 236, 246, 258, 274, 297, 386, 397], "unsignedinteg": 10, "uint8": [10, 258], "uint16": [10, 258], "uint32": [10, 23, 24, 25, 26, 192, 258], "uint64": [10, 258], "signedinteg": [10, 144], "int8": [10, 258], "int32": [10, 16, 35, 130, 144, 148, 197, 258, 320, 397, 400], "int64": [10, 258], "inexact": [10, 144], "complexflo": 10, "complex128": 10, "issubdtyp": [10, 258], "absolut": [11, 14, 139, 331, 332, 350], "semant": [12, 81, 103, 104, 106, 135, 136, 146, 147, 156, 161, 163, 176, 178, 181, 228, 402], "keepdim": [13, 15, 23, 24, 30, 31, 32, 33, 52, 53, 54, 55, 59, 71, 75, 148, 160, 162, 164, 175, 187, 218, 225, 229, 244], "reduct": [13, 15, 160, 162, 175, 187, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351], "reduc": [13, 15, 23, 24, 160, 162, 164, 175, 187, 225, 229, 244, 268, 319, 346], "unspecifi": [13, 15, 16, 23, 24, 25, 26, 85, 92, 93, 94, 95, 133, 160, 162, 164, 175, 182, 186, 187, 203, 218, 219, 225, 229, 232, 238, 244, 248, 403], "entir": [13, 15, 23, 24, 160, 162, 164, 175, 187, 225, 229, 244, 272, 273], "singleton": [13, 15, 23, 24, 160, 161, 162, 164, 175, 187, 225, 229, 244], "rtol": [14, 139], "05": [14, 139, 268, 277, 278, 280, 309], "atol": [14, 139], "08": [14, 139, 339, 373, 374, 375, 376, 382], "equal_nan": [14, 76, 139], "approxim": [14, 275, 330, 331, 332], "comparison": [14, 106, 135, 136, 146, 147, 181], "infinit": [14, 139], "equal": [14, 25, 76, 113, 136, 139, 147, 181, 186, 197, 220, 278, 281], "sign": [14, 139, 258, 377], "nan": [14, 76, 139, 141], "ab": [14, 139, 148, 243, 277, 278, 280, 284, 309, 332, 352, 395], "array_equ": [14, 139], "rel": [14, 139, 372, 395], "toler": [14, 139], "boolean": [14, 76, 80, 139, 140, 141, 142, 143, 157, 158, 159, 258, 301, 397], "interv": [16, 150, 197, 201], "increment": 16, "otherwis": [16, 88, 172, 250, 252, 253, 254, 290, 292, 302, 318, 319, 320, 338, 343, 350, 361, 362, 398, 399], "convent": [16, 89, 320, 375], "lead": [16, 395], "fraction": 16, "integr": [16, 232, 398], "invers": [17, 18, 19, 20, 21, 22, 108, 121, 122, 123, 124, 125, 126], "cosin": [17, 18, 90, 91, 339, 384, 386, 396], "hyperbol": [18, 20, 22, 91, 217, 235, 363], "sine": [19, 20, 216, 217, 396], "minimum": [24, 35, 83, 93, 316, 339, 384], "kth": [25, 186], "partit": 25, "order": [25, 88, 148, 186, 188, 238, 264, 277, 303, 314, 379, 395, 396], "undefin": [25, 186, 195, 397], "sort": [25, 26, 186, 238], "flatten": [25, 26, 92, 93, 94, 95, 148, 184, 186, 203, 219, 232, 233, 238, 252], "dimension": [27, 114, 115, 118, 119, 120, 121, 122, 123, 127, 128, 129, 266, 267, 268, 269, 270, 274, 281, 282, 283, 307, 308, 316, 397, 399], "val": [27, 133], "tupl": [27, 61, 64, 74, 85, 87, 88, 104, 109, 111, 145, 148, 149, 185, 188, 204, 223, 243, 245, 252, 253, 254, 255, 266, 267, 270, 282, 283, 292, 294, 314, 320, 372, 374, 375, 376, 377, 394, 396], "ndarrai": [27, 397, 398, 400], "properti": [28, 35, 43, 47, 57, 58, 64, 66, 298, 301, 380, 396], "argument": [28, 61, 74, 84, 109, 134, 243, 253, 254, 264, 320, 392, 396, 401, 402, 403], "union": [29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 44, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 59, 60, 61, 62, 63, 65, 67, 68, 69, 70, 71, 72, 74, 75, 77, 78, 79, 80, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 142, 143, 199, 200, 227], "appli": [35, 116, 117, 253, 254, 264, 266, 267, 268, 269, 270, 272, 273, 275, 277, 278, 280, 281, 282, 283, 284, 286, 299, 306, 308, 309, 310, 311, 313, 315, 317, 318, 320, 329, 330, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 365, 378, 381, 387, 390, 395], "regular": [35, 272, 352, 375, 395, 397], "idx": [35, 397], "correctli": 35, "syntax": [35, 397], "subtract": 35, "inclus": [37, 38, 39, 40, 92, 93, 94, 95, 130], "diagon": [41, 100, 113, 240, 241, 242], "axis1": [42, 72, 101, 230], "axis2": [42, 72, 101, 230], "start_axi": [45, 130], "end_axi": [45, 130], "datatyp": 47, "byte": [47, 57, 167, 168, 169, 171, 172, 258], "decim": [62, 205], "indices_or_sect": [67, 220], "nest": [73, 84, 264, 368, 394, 396], "ddof": [75, 225, 244], "ari": [77, 78, 79], "block_siz": 80, "64": [80, 99, 188, 189, 250, 258, 307, 308], "mask_out": 80, "mask_lh": 80, "mask_rh": 80, "lhs_mask": 80, "lceil": 80, "rceil": 80, "rhs_mask": 80, "out_mask": 80, "a_min": 83, "a_max": 83, "edg": [83, 185, 320, 395], "At": 83, "anoth": [83, 144, 161, 228, 247, 258, 264, 285, 395, 396, 397, 402], "fun": [84, 134, 145, 243, 245, 246, 395, 397, 398, 402], "callabl": [84, 134, 145, 243, 245, 246, 250, 251, 252, 253, 254, 285, 286, 289, 297, 310, 314, 319, 321, 322, 323, 324, 325, 326, 327, 328, 371, 372, 373, 374, 375, 376, 377, 382, 383, 384, 385, 386, 387, 388], "shapeless": 84, "dict": [84, 109, 151, 208, 209, 210, 295, 300, 303, 304, 368, 378, 379, 381, 394, 396, 401], "arbitrarili": [84, 264, 394, 396, 400], "leaf": [84, 250, 252, 253, 254, 289], "node": [84, 109, 246, 254], "recompil": [84, 395], "chang": [84, 213, 303, 308, 320, 343, 350, 395, 399], "Not": [84, 181, 395], "attempt": 84, "pad": [86, 87, 88, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 266, 267, 269, 270, 282, 283], "dilat": [86, 87, 88, 269, 270], "group": [86, 87, 88, 99, 117, 188, 189, 250, 277, 307, 308], "1d": [86, 88, 89, 208, 233], "convolut": [86, 87, 88, 89, 269, 270, 272, 273], "channel": [86, 87, 88, 268, 269, 270, 272, 273], "c_in": [86, 87, 88], "c_out": [86, 87, 88], "convolv": [86, 87, 88], "2d": [87, 88, 101, 188, 268, 272], "spatial": [87, 88, 266, 277, 282, 320], "symmetr": 87, "kernel_dil": 88, "input_dil": 88, "flip": [88, 89], "correl": [88, 272], "discret": [89, 118, 119, 120, 121, 122, 123, 127, 128, 129, 274, 307], "swap": [89, 172, 230, 304], "conv": 89, "filter": [89, 269, 270, 285, 289], "signal": [89, 320], "cumul": [92, 93, 94, 95], "th": [92, 93, 94, 95, 100, 113, 386], "angl": [98, 190], "radian": 98, "bias": [99, 188, 189, 276, 279, 290, 302, 305], "group_siz": [99, 188, 189, 250, 307, 308], "bit": [99, 188, 189, 250, 258, 285, 307, 308, 309], "configur": 99, "formal": [99, 188], "notat": [99, 252, 294], "quantiz": [99, 151, 189, 307, 308], "w_i": [99, 188], "hat": [99, 188], "occupi": [99, 188, 189], "subarrai": [101, 220], "remov": [101, 161, 192, 223, 340], "insert": [101, 111, 402], "end": [101, 170, 188, 267, 276, 279, 283, 318, 343, 350, 356, 361, 362, 387], "neg": [101, 130, 142, 282, 283, 305, 341, 349, 351, 397], "taken": [101, 232], "global": [102, 105, 198, 392, 395], "disabl": [102, 171, 395], "mlx_disable_compil": [102, 105, 395], "divis": [103, 132, 188], "quotient": [103, 104, 132], "remaind": 104, "fuction": 104, "mathrm": [107, 214, 278], "frac": [107, 188, 214, 266, 267, 268, 271, 272, 273, 277, 278, 280, 281, 282, 283, 309, 322, 323, 324, 325, 339, 341, 343, 346, 357, 359, 371, 373, 374, 375, 376, 382], "pi": [107, 275, 316, 331, 396], "int_0": 107, "dt": 107, "erf": [108, 395], "exponenti": [110, 112, 313, 329, 356, 385], "minu": 112, "exp": [112, 156, 160, 193, 218, 329, 344, 356, 357, 360, 395, 402], "ident": [113, 226, 264, 299], "zero": [113, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 165, 240, 241, 242, 249, 264, 266, 267, 271, 272, 273, 292, 321, 322, 323, 324, 325, 326, 327, 328, 365, 372, 397], "whose": [113, 250, 251], "translat": [114, 280], "stabil": [114, 115, 268, 277, 278, 280, 309, 339, 341, 371, 372, 373, 374, 375, 376, 382], "traditino": 116, "rotat": [116, 312], "larger": [116, 312, 377], "unchang": [116, 226, 312], "consecut": [116, 188, 312], "angular": [116, 312], "frequenc": [116, 312, 316], "q": [117, 149], "head": [117, 305, 319], "attent": [117, 290, 305, 316, 319], "regardless": 117, "pre": 117, "tile": 117, "typic": [117, 274, 370, 395, 398], "One": [118, 121, 127, 206, 395, 396], "fourier": [118, 119, 120, 121, 122, 123, 127, 128, 129], "truncat": [118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 200], "dft": [118, 119, 120, 121, 122, 123, 127, 128, 129], "rfft": 124, "real": [124, 125, 126, 127, 128, 129], "rfft2": 125, "rfftn": 126, "silent": [127, 128, 129], "outsid": 130, "clamp": 130, "floor": 132, "argnam": [134, 243], "neither": [134, 243], "keyword": [134, 210, 211, 243, 253, 264, 392, 401, 403], "strict": [135, 146, 290, 292, 302], "ordinari": 138, "inifn": 140, "infin": [140, 142, 143, 282, 283, 376], "dtypecategori": [144, 258], "subtyp": [144, 258], "subdtyp": 144, "float64": 144, "too": [144, 395, 398], "ord": 148, "tabl": [148, 258, 274], "frobeniu": 148, "matric": [148, 149], "strictli": 148, "mathemat": 148, "variou": 148, "purpos": 148, "calcul": [148, 341, 347, 372], "fro": 148, "inf": [148, 305], "largest": [148, 238], "sing": 148, "smallest": 148, "singular": 148, "nuclear": 148, "_f": 148, "sum_": [148, 266, 267, 346], "a_": 148, "valueerror": [148, 292, 396], "refer": [148, 278, 284, 298, 322, 323, 324, 325, 332, 352, 397], "golub": 148, "van": 148, "loan": 148, "baltimor": 148, "md": 148, "john": 148, "hopkin": 148, "univers": 148, "1985": 148, "pg": 148, "la": 148, "arang": [148, 258, 320, 397, 399], "9": [148, 340, 371, 374, 375, 376, 377, 379, 385, 388, 399], "74597": 148, "20": 148, "84804": 148, "41421": 148, "23607": [148, 149], "74166": 148, "24264": 148, "11": 148, "225": 148, "894427": 149, "447214": 149, "57771": 149, "50": 150, "evenli": 150, "return_metadata": 151, "binari": [151, 207, 208, 209, 210, 211, 318, 338, 362, 395], "npy": [151, 207, 401], "safetensor": [151, 209, 292, 296, 398, 401], "gguf": [151, 208, 401], "matadata": 151, "unsupport": 151, "tensor": [151, 236, 266, 267, 282, 283, 351, 399], "natur": [152, 154, 398], "logarithm": [152, 153, 154, 155], "log": [154, 156, 160, 336, 337, 341, 344, 346, 349, 360], "plu": 154, "stabl": [156, 160, 218, 346], "spars": 165, "xy": 165, "multidimension": 165, "coordin": 165, "dens": [165, 402], "cartesian": 165, "ij": 165, "clear": 166, "get_cache_memori": 166, "alwai": [167, 252, 396], "report": [167, 172], "peak": 169, "begin": [169, 188, 267, 276, 279, 283, 318, 343, 350, 356, 361, 362], "program": 169, "free": 171, "reclaim": 171, "set_memory_limit": 171, "previou": [171, 172], "relax": 172, "task": [172, 346], "exceed": 172, "potenti": 172, "negat": 179, "beforehand": 184, "pad_with": 185, "constant_valu": 185, "pad_width": 185, "before_1": 185, "after_1": 185, "before_2": 185, "after_2": 185, "before_n": 185, "after_n": 185, "before_i": 185, "after_i": 185, "side": [185, 266, 267, 282, 283, 395], "smaller": [186, 377, 395], "everi": [188, 253, 388, 396], "particular": [188, 277], "w_1": 188, "w_g": 188, "align": [188, 267, 276, 279, 283], "max_i": 188, "min_i": 188, "textrm": [188, 275, 330, 333], "round": 188, "pack": [188, 189], "unsign": [188, 189, 258], "lower": [188, 197, 200, 201, 240, 328], "upper": [188, 197, 200, 201, 328], "1st": 188, "signific": 188, "2nd": 188, "dequant": 188, "w_q": 188, "whether": [189, 276, 279, 289, 305, 310, 338, 341, 347], "degre": [190, 351], "prng": [191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 392], "num_sampl": 192, "unnorm": [192, 338, 340], "draw": 192, "cdf": [193, 275, 330], "accord": [193, 247, 250, 305, 322, 323, 324, 325], "seed": 194, "cov": 195, "jointli": 195, "covari": [195, 268], "semi": 195, "definit": 195, "behavior": [195, 346, 397, 398], "empti": 195, "loc": 196, "deviat": [196, 225, 322, 324, 327], "low": [197, 201, 328, 365], "high": [197, 201, 264, 274, 328, 365], "bound": [197, 200, 201, 275, 328, 395, 397, 402], "roadcast": 197, "domain": 200, "uniformli": 201, "repetit": 203, "preserv": [204, 396], "reciproc": 206, "arr": [207, 397], "obj": 208, "uncompress": 210, "my_path": 210, "tree_flatten": [210, 253, 255, 264], "transformerencod": 210, "128": [210, 264], "flat_param": 210, "compress": 211, "possibl": [220, 274, 307, 395, 397, 402], "divisor": [225, 244], "varianc": [225, 244, 268, 277, 341], "being": [226, 264], "prevent": [226, 351, 399], "flow": [226, 398], "streamcontext": 227, "context": 227, "manag": [227, 392, 402], "prior": [232, 233], "exclud": 233, "dot": [236, 252, 294, 305], "rep": 237, "repeat": 237, "necessarili": 238, "elsewher": [240, 397], "col": 240, "triangl": 240, "mse": 243, "param": [243, 264, 365, 396], "lvalu": 243, "dlvalu": 243, "dparam": 243, "lasso": 243, "l1": [243, 343, 345, 346, 350], "in_ax": [246, 396], "out_ax": [246, 396], "prefix": [246, 252], "class_pred": 250, "predic": [250, 297], "receiv": [250, 386, 399], "fn": [251, 253, 254, 400], "wrt": 251, "is_leaf": [252, 253, 254], "arbitrari": [252, 368], "depth": [252, 273, 396], "hello": [252, 255], "charact": 252, "flat": [252, 255], "superset": [253, 378], "extra": [253, 254], "closer": 253, "decid": [253, 289], "constitut": 253, "dict_kei": [253, 379], "lambda": [253, 254, 264, 285, 290, 297, 317, 356, 361, 371, 372, 373, 374, 375, 376, 377, 382, 383, 395, 396], "tree_map": [254, 264], "new_tre": 254, "recreat": 255, "world": 255, "42": 255, "16": [258, 266, 278, 282, 285, 368], "int16": 258, "brain": 258, "e8": 258, "m7": 258, "ieee": 258, "e5": 258, "m10": 258, "hierarchi": 258, "done": [264, 271, 309, 395, 398, 399], "manual": 264, "explicitli": [264, 392], "solv": 264, "intuit": 264, "freez": [264, 302, 368], "finetun": 264, "in_dim": [264, 368], "out_dim": [264, 368], "enumer": 264, "caus": [264, 395, 398], "local": [264, 272], "scope": 264, "l2_loss": 264, "y_hat": 264, "trainable_paramet": [264, 289, 379], "loss_and_grad": 264, "workhors": 264, "Its": 264, "recurs": [264, 289, 290, 295, 300, 302, 368], "frozen": [264, 290, 300, 302, 308, 368], "individu": [264, 272, 273], "subset": [264, 289], "action": 264, "displai": 264, "count": [264, 386], "num_param": 264, "preclud": 264, "pure": [264, 370], "pattern": [264, 398], "achiev": 264, "other_input": 264, "necessari": 264, "wrap": 264, "apply_to_modul": [264, 290], "children": 264, "filter_and_map": 264, "leaf_modul": 264, "load_weight": [264, 398], "named_modul": 264, "save_weight": 264, "set_dtyp": 264, "unfreez": [264, 290], "update_modul": 264, "alibi": 264, "avgpool1d": 264, "avgpool2d": 264, "batchnorm": 264, "conv1d": 264, "conv2d": 264, "dropout": [264, 272, 273, 299, 319, 395], "dropout2d": 264, "dropout3d": 264, "gelu": [264, 331, 332, 395], "groupnorm": 264, "gru": 264, "instancenorm": 264, "layernorm": 264, "lstm": 264, "maxpool1d": 264, "maxpool2d": 264, "mish": 264, "prelu": 264, "quantizedembed": 264, "quantizedlinear": 264, "relu": [264, 306, 319, 353, 365], "rnn": [264, 276], "selu": 264, "sequenti": [264, 365], "silu": 264, "sinusoidalpositionalencod": 264, "softshrink": 264, "upsampl": 264, "elu": [264, 356], "gelu_approx": [264, 275, 330], "gelu_fast_approx": [264, 275, 330], "hardswish": 264, "leaky_relu": 264, "log_sigmoid": 264, "log_softmax": 264, "relu6": 264, "softplu": [264, 284, 352], "tanh": [264, 275, 276, 279, 284, 310, 331, 352], "binary_cross_entropi": [264, 395], "cosine_similarity_loss": 264, "gaussian_nll_loss": 264, "hinge_loss": 264, "huber_loss": 264, "kl_div_loss": 264, "l1_loss": 264, "log_cosh_loss": 264, "margin_ranking_loss": 264, "mse_loss": 264, "nll_loss": 264, "smooth_l1_loss": 264, "triplet_loss": 264, "init": [264, 306, 365, 370, 384, 385, 387, 388], "glorot_norm": 264, "glorot_uniform": 264, "he_norm": 264, "he_uniform": 264, "kernel_s": [266, 267, 269, 270, 282, 283], "averag": [266, 267, 371, 372, 374, 375, 376], "pool": [266, 267, 282, 283, 402], "l_": [266, 282, 343], "n_i": [266, 267, 282, 283], "c_j": [266, 267, 282, 283], "ldot": [266, 267, 282, 283], "lfloor": [266, 267, 282, 283], "_size": [266, 267, 282, 283], "rfloor": [266, 267, 282, 283], "k_h": [267, 283], "k_w": [267, 283], "h_": [267, 276, 279, 283, 310], "w_": [267, 276, 279, 283, 310, 371, 372, 373, 374, 375, 376, 377, 382, 383], "height": [267, 268, 270, 272, 273, 283], "width": [267, 268, 270, 272, 273, 283, 307, 308], "momentum": [268, 377, 379, 383, 395], "affin": [268, 277, 278, 280, 281, 308], "track_running_stat": 268, "var": [268, 277, 278, 280, 341], "epsilon": [268, 277, 278, 280, 309, 339, 341, 371, 373, 374, 375, 376, 382], "gamma": [268, 277, 278, 280, 309, 322, 323, 324, 325], "nc": 268, "nlc": [268, 269], "four": 268, "nhwc": [268, 270], "paper": [268, 316, 371, 372, 373, 374, 376, 377], "deep": [268, 322, 323, 324, 325], "intern": 268, "shift": 268, "bn": 268, "in_channel": [269, 270], "out_channel": [269, 270], "learnabl": [269, 270, 314], "imag": [270, 272, 273, 320], "portion": 271, "independ": [272, 273], "nwhc": 272, "whc": 272, "maintain": [272, 273, 377], "entri": [272, 273], "benefici": [272, 273, 398], "earli": 272, "adjac": 272, "pixel": 272, "effect": [272, 395, 398], "thompson": 272, "goroshin": 272, "jain": 272, "lecun": 272, "bregler": 272, "2015": [272, 374, 376], "cvpr": 272, "ndhwc": 273, "dhwc": 273, "often": 273, "medic": 273, "video": 273, "num_embed": [274, 307], "lookup": 274, "usual": [274, 307, 394, 398], "vocabulari": [274, 307], "approx": 275, "unit": [275, 276, 311, 313, 315, 322, 323, 324, 325, 329, 330, 331, 332, 333, 335, 354, 355, 356, 358], "phi": [275, 330], "geluapprox": 275, "044715": [275, 331], "gelufast": 275, "sigma": [275, 276, 279, 322, 323, 324, 325, 332, 333, 336, 357, 358], "773": 275, "regard": 275, "input_s": [276, 279, 310], "hidden_s": [276, 279, 310], "gate": [276, 333], "recurr": [276, 279, 310], "nld": [276, 279, 310], "ld": [276, 279, 310], "r_t": 276, "xr": 276, "x_t": [276, 279, 310], "hr": 276, "h_t": [276, 279, 310], "b_": [276, 279], "z_t": 276, "xz": 276, "hz": 276, "n_t": 276, "xn": 276, "odot": [276, 279], "hn": 276, "hidden": [276, 279, 310, 319], "nh": [276, 279, 310], "nlh": [276, 279, 310], "lh": [276, 279, 310], "num_group": 277, "pytorch_compat": 277, "split": [277, 333], "preced": 277, "org": [277, 278, 280, 284, 309, 332, 352], "1803": 277, "08494": 277, "denomin": [278, 339, 371, 373, 374, 375, 376, 382], "inorm": 278, "1607": [278, 280], "08022": 278, "i_t": 279, "xi": 279, "f_t": 279, "xf": 279, "hf": 279, "g_t": [279, 371, 373, 374, 375, 376, 377, 382, 383], "xg": 279, "hg": 279, "o_t": 279, "xo": 279, "ho": 279, "c_": [279, 377], "c_t": [279, 377], "cell": 279, "06450": 280, "realli": 280, "mathcal": 281, "d_i": 281, "max_": [282, 283], "1908": [284, 352], "08681": [284, 352], "map_fn": [285, 289], "filter_fn": [285, 289], "valid_parameter_filt": 285, "apply_fn": 286, "descend": 287, "is_leaf_fn": 289, "found": 289, "drop": 289, "idempot": [290, 302], "endswith": 290, "file_or_weight": 292, "miss": [292, 401], "ok": [292, 396], "save_safetensor": [296, 401], "reflect": [298, 395, 397, 399], "ie": 302, "noop": 302, "unfrozen": 302, "tracer": 303, "partial": [303, 304, 395, 398], "child": 304, "flexibli": 304, "programmat": 304, "query_input_dim": 305, "key_input_dim": 305, "value_input_dim": 305, "value_dim": 305, "value_output_dim": 305, "aggreg": 305, "linearli": 305, "attend": 305, "num_paramet": 306, "25": [306, 320], "parametr": [306, 353], "from_embed": 307, "classmethod": [307, 308], "from_linear": 308, "accumul": 309, "1910": 309, "07467": 309, "nonlinear": [310, 395], "elman": 310, "ih": 310, "hh": 310, "func": 310, "rectifi": [311, 324, 325, 335, 354, 355], "10000": 312, "slightli": [312, 402], "plain": 314, "known": [315, 358], "swish": [315, 358], "min_freq": 316, "0001": 316, "max_freq": 316, "cos_first": 316, "full_turn": 316, "sinusoid": 316, "sin": [316, 396, 400], "lambd": [317, 361], "threshold": [318, 343, 350, 362], "geq": [318, 362], "num_encoder_lay": 319, "num_decoder_lay": 319, "nb_func": 319, "custom_encod": 319, "custom_decod": 319, "norm_first": 319, "checkpoint": 319, "decod": 319, "interact": 319, "mechan": 319, "chekpoint": 319, "usag": [319, 395], "expens": 319, "scale_factor": 320, "nearest": 320, "align_corn": 320, "audio": 320, "4d": 320, "forth": 320, "algorithm": [320, 377], "neighbor": 320, "interpol": 320, "cubic": 320, "bilinear": 320, "trilinear": 320, "bicub": 320, "corner": 320, "bottom": 320, "squeez": [320, 395], "75": 320, "33333": 320, "66667": 320, "init_fn": [321, 322, 323, 324, 325, 326, 327, 328, 365], "glorot": [322, 323], "fan_in": [322, 323, 324, 325], "fan_out": [322, 323, 324, 325], "fan": [322, 323, 324, 325], "_in": [322, 323], "_out": [322, 323], "difficulti": [322, 323], "feedforward": [322, 323], "191107": 322, "61278": 322, "150594": 322, "363207": 322, "gain": [322, 323, 324, 325], "89613": 322, "53947": 322, "48095": 322, "995016": 322, "223404": 323, "890597": 323, "379159": 323, "776856": 323, "90041": 323, "02264": 323, "912766": 323, "12451": 323, "delv": [324, 325], "surpass": [324, 325], "human": [324, 325], "level": [324, 325], "imagenet": [324, 325], "classif": [324, 325], "25211": 324, "458835": 324, "177208": 324, "0137595": 324, "6967": 324, "02765": 324, "15268": 324, "75787": 324, "kaim": 325, "0300242": 325, "0184009": 325, "793615": 325, "666329": 325, "64331": 325, "16506": 325, "08619": 325, "79854": 325, "982273": 327, "534422": 327, "380709": 327, "0645099": 327, "883935": 328, "863726": 328, "617261": 328, "417497": 328, "exact": [331, 332], "0005": 331, "015": 332, "702": 332, "cdot": [332, 339, 342, 358], "hendryck": 332, "1606": 332, "08415": 332, "halv": 333, "negative_slop": 335, "leaki": 335, "sum_i": 337, "x_i": [337, 359], "with_logit": 338, "predict": [338, 341, 342, 343, 344, 345, 346, 348, 349, 350], "105361": 338, "223144": 338, "20397": 338, "916291": 338, "539245": 338, "prob": 338, "510826": 338, "x1": 339, "x2": 339, "x_1": [339, 347], "x_2": [339, 347], "label_smooth": 340, "hot": 340, "smooth": [340, 350, 382], "0485873": 340, "348587": 340, "06": [341, 351, 371], "likelihood": [341, 349], "nll": [341, 349], "hing": 342, "y_": [342, 346], "pred": [342, 346], "delta": [343, 371], "huber": 343, "leq": [343, 356], "l2": [343, 346, 383], "kullback": 344, "leibler": 344, "diverg": 344, "cosh": 346, "logcosh": 346, "sensit": 346, "outlier": 346, "dual": 346, "offer": 346, "balanc": 346, "robust": 346, "approach": [346, 396], "inputs1": 347, "inputs2": 347, "margin": [347, 351], "rank": 347, "573409": 347, "765166": 347, "0638": 347, "75596": 347, "225763": 347, "256995": 347, "773433": 347, "formula": 350, "anchor": 351, "triplet": 351, "_p": 351, "pairwis": 351, "instabl": 351, "monoton": 352, "0507": 356, "67326": 356, "sum_j": 359, "x_j": 359, "subclass": 368, "concept": 368, "mymlp": 368, "in_proj": 368, "involv": [370, 395], "subsequ": 370, "far": 370, "apply_gradi": 370, "rmsprop": 370, "adagrad": 370, "adafactor": 370, "adadelta": 370, "adam": [370, 376, 377, 386, 387], "adamw": [370, 377], "adamax": 370, "lion": 370, "cosine_decai": [370, 386], "exponential_decai": 370, "join_schedul": 370, "linear_schedul": [370, 386], "step_decai": 370, "rho": 371, "zeiler": 371, "2012": [371, 382], "adapt": [371, 372, 373], "1212": 371, "5701": 371, "v_": [371, 373, 374, 375, 376, 382, 383], "v_t": [371, 373, 374, 375, 376, 382, 383], "u_t": 371, "u_": 371, "w_t": [371, 373, 374, 375, 376, 377, 382, 383], "30": 372, "001": 372, "clip_threshold": 372, "decay_r": [372, 385, 388], "beta_1": [372, 374, 375, 376, 377], "weight_decai": [372, 375, 377, 383], "scale_paramet": 372, "relative_step": 372, "warmup_init": 372, "sublinear": 372, "cost": [372, 398], "epsilon_1": 372, "epsilon_2": 372, "parameter_scal": 372, "clip": 372, "unscal": 372, "decai": [372, 375, 377, 383, 384, 385, 388], "duchi": 373, "hazan": 373, "singer": 373, "2011": 373, "subgradi": 373, "onlin": 373, "stochast": [373, 374, 376, 383, 398], "jmlr": 373, "999": [374, 375, 376], "omit": [374, 376], "estim": [374, 376], "kingma": [374, 376], "ba": [374, 376], "iclr": [374, 375, 376], "m_": [374, 375, 376, 377], "m_t": [374, 375, 376, 377], "beta_2": [374, 375, 376, 377], "contrast": 375, "loshchilov": 375, "hutter": 375, "decoupl": 375, "99": [377, 382], "tend": 377, "10x": 377, "strength": [377, 383], "wd": 377, "chen": 377, "symbol": 377, "discoveri": 377, "2302": 377, "06675": 377, "eta": 377, "opt": 378, "tieleman": 382, "hinton": 382, "lectur": 382, "coursera": 382, "dampen": 383, "nesterov": 383, "descent": [383, 395, 398], "mu": 383, "tau": 383, "penalti": 383, "decay_step": 384, "beyond": [384, 387], "minim": 384, "lr_schedul": [384, 385, 386, 388], "1000": [384, 395], "0999961": 384, "06561": 385, "boundari": 386, "join": 386, "transit": 386, "warmup": [386, 387], "0999938": 386, "101": 387, "step_siz": 388, "081": 388, "basi": 390, "implicit": [392, 395, 396], "fine": [392, 398], "grain": 392, "control": [392, 398], "pseudo": 392, "altern": 392, "splittabl": 392, "threefri": 392, "counter": 392, "cycl": 394, "merg": 395, "fuse": 395, "big": 395, "awar": [395, 398], "36788": 395, "compiled_fun": 395, "code": [395, 398], "slow": 395, "stack": 395, "rerun": [395, 398], "frequent": [395, 398], "destroi": 395, "anonym": 395, "don": [395, 402], "unari": 395, "overhead": [395, 398, 402], "bandwidth": 395, "fusibl": 395, "consider": 395, "versu": 395, "timeit": [395, 396], "tic": 395, "perf_count": 395, "toc": 395, "tpi": 395, "1e3": 395, "4096": [395, 396, 402], "On": [395, 396, 398], "millisecond": [395, 402], "five": 395, "latest": 395, "won": 395, "placehold": 395, "insid": 395, "crash": 395, "disable_compil": 395, "okai": [395, 398], "intend": 395, "deal": 395, "pretti": [395, 398], "inconveni": 395, "functool": 395, "particularli": 395, "backward": [395, 396], "compiled_grad_fn": 395, "71828": 395, "outer": [395, 398], "opportun": 395, "inner": 395, "idea": [396, 398], "behind": 396, "dfdx": [396, 397], "d2fdx2": 396, "zero_grad": 396, "detach": 396, "requires_grad": 396, "dloss_dw": 396, "dloss_dx": 396, "lot": 396, "redund": 396, "continu": 396, "suppos": [396, 402], "nice": [396, 398], "propag": [396, 397], "stop_gradi": 396, "autom": 396, "contriv": [396, 402], "sake": 396, "clariti": 396, "quit": [396, 399], "power": [396, 399], "difficult": 396, "primit": 396, "issu": [396, 399], "priorit": 396, "naive_add": 396, "vmap_add": 396, "total": 396, "390": 396, "wherea": 396, "025": 396, "ten": [396, 398], "Of": 396, "cours": 396, "better": [396, 402], "handi": 396, "slice": 397, "ellipsi": 397, "mix": 397, "take_along_axi": 397, "lack": 397, "extrem": [397, 398], "ineffici": [397, 398], "nonzero": 397, "dynam": 398, "easier": 398, "worri": 398, "fun1": 398, "expensive_fun": 398, "consum": 398, "eager": 398, "thank": 398, "weights_fp16": 398, "trade": 398, "bad": 398, "grow": 398, "computation": 398, "costli": 398, "luckili": 398, "wide": 398, "thousand": 398, "value_and_grad_fn": 398, "implicitli": 398, "anytim": 398, "memoryview": [398, 399], "perfectli": 398, "first_lay": 398, "second_layer_a": 398, "second_layer_b": 398, "protocol": 399, "pep": 399, "3118": 399, "a_view": 399, "owndata": 399, "extern": 399, "demonstr": 399, "x_view": 399, "modifi": 399, "df": 399, "x\u00b2": 399, "2x": 399, "indirectli": 399, "modif": 399, "seen": 399, "occur": 399, "incorpor": 399, "aris": 399, "incorrect": 399, "experiment": 399, "break": 399, "advis": 399, "intermedi": 399, "jnp": 399, "tf": 399, "page": 400, "composit": 400, "archiv": 401, "savez_compress": 401, "save_gguf": 401, "arr_0": 401, "advantag": 402, "parallel": 402, "race": 402, "interest": 402, "albeit": 402, "d1": 402, "d2": 402, "matmul": 402, "But": 402, "twice": 402, "measur": 402, "default_stream": 403, "default_devic": 403, "my_devic": 403}, "objects": {"mlx.core": [[8, 0, 1, "", "Device"], [9, 0, 1, "", "Dtype"], [10, 0, 1, "", "DtypeCategory"], [256, 0, 1, "", "Stream"], [11, 2, 1, "", "abs"], [12, 2, 1, "", "add"], [13, 2, 1, "", "all"], [14, 2, 1, "", "allclose"], [15, 2, 1, "", "any"], [16, 2, 1, "", "arange"], [17, 2, 1, "", "arccos"], [18, 2, 1, "", "arccosh"], [19, 2, 1, "", "arcsin"], [20, 2, 1, "", "arcsinh"], [21, 2, 1, "", "arctan"], [22, 2, 1, "", "arctanh"], [23, 2, 1, "", "argmax"], [24, 2, 1, "", "argmin"], [25, 2, 1, "", "argpartition"], [26, 2, 1, "", "argsort"], [27, 0, 1, "", "array"], [76, 2, 1, "", "array_equal"], [77, 2, 1, "", "atleast_1d"], [78, 2, 1, "", "atleast_2d"], [79, 2, 1, "", "atleast_3d"], [80, 2, 1, "", "block_masked_mm"], [81, 2, 1, "", "broadcast_to"], [82, 2, 1, "", "ceil"], [83, 2, 1, "", "clip"], [84, 2, 1, "", "compile"], [85, 2, 1, "", "concatenate"], [86, 2, 1, "", "conv1d"], [87, 2, 1, "", "conv2d"], [88, 2, 1, "", "conv_general"], [89, 2, 1, "", "convolve"], [90, 2, 1, "", "cos"], [91, 2, 1, "", "cosh"], [92, 2, 1, "", "cummax"], [93, 2, 1, "", "cummin"], [94, 2, 1, "", "cumprod"], [95, 2, 1, "", "cumsum"], [96, 2, 1, "", "default_device"], [97, 2, 1, "", "default_stream"], [98, 2, 1, "", "degrees"], [99, 2, 1, "", "dequantize"], [100, 2, 1, "", "diag"], [101, 2, 1, "", "diagonal"], [102, 2, 1, "", "disable_compile"], [103, 2, 1, "", "divide"], [104, 2, 1, "", "divmod"], [105, 2, 1, "", "enable_compile"], [106, 2, 1, "", "equal"], [107, 2, 1, "", "erf"], [108, 2, 1, "", "erfinv"], [109, 2, 1, "", "eval"], [110, 2, 1, "", "exp"], [111, 2, 1, "", "expand_dims"], [112, 2, 1, "", "expm1"], [113, 2, 1, "", "eye"], [130, 2, 1, "", "flatten"], [131, 2, 1, "", "floor"], [132, 2, 1, "", "floor_divide"], [133, 2, 1, "", "full"], [134, 2, 1, "", "grad"], [135, 2, 1, "", "greater"], [136, 2, 1, "", "greater_equal"], [137, 2, 1, "", "identity"], [138, 2, 1, "", "inner"], [139, 2, 1, "", "isclose"], [140, 2, 1, "", "isinf"], [141, 2, 1, "", "isnan"], [142, 2, 1, "", "isneginf"], [143, 2, 1, "", "isposinf"], [144, 2, 1, "", "issubdtype"], [145, 2, 1, "", "jvp"], [146, 2, 1, "", "less"], [147, 2, 1, "", "less_equal"], [150, 2, 1, "", "linspace"], [151, 2, 1, "", "load"], [152, 2, 1, "", "log"], [153, 2, 1, "", "log10"], [154, 2, 1, "", "log1p"], [155, 2, 1, "", "log2"], [156, 2, 1, "", "logaddexp"], [157, 2, 1, "", "logical_and"], [158, 2, 1, "", "logical_not"], [159, 2, 1, "", "logical_or"], [160, 2, 1, "", "logsumexp"], [161, 2, 1, "", "matmul"], [162, 2, 1, "", "max"], [163, 2, 1, "", "maximum"], [164, 2, 1, "", "mean"], [165, 2, 1, "", "meshgrid"], [175, 2, 1, "", "min"], [176, 2, 1, "", "minimum"], [177, 2, 1, "", "moveaxis"], [178, 2, 1, "", "multiply"], [179, 2, 1, "", "negative"], [180, 2, 1, "", "new_stream"], [181, 2, 1, "", "not_equal"], [182, 2, 1, "", "ones"], [183, 2, 1, "", "ones_like"], [184, 2, 1, "", "outer"], [185, 2, 1, "", "pad"], [186, 2, 1, "", "partition"], [187, 2, 1, "", "prod"], [188, 2, 1, "", "quantize"], [189, 2, 1, "", "quantized_matmul"], [190, 2, 1, "", "radians"], [202, 2, 1, "", "reciprocal"], [203, 2, 1, "", "repeat"], [204, 2, 1, "", "reshape"], [205, 2, 1, "", "round"], [206, 2, 1, "", "rsqrt"], [207, 2, 1, "", "save"], [208, 2, 1, "", "save_gguf"], [209, 2, 1, "", "save_safetensors"], [210, 2, 1, "", "savez"], [211, 2, 1, "", "savez_compressed"], [212, 2, 1, "", "set_default_device"], [213, 2, 1, "", "set_default_stream"], [214, 2, 1, "", "sigmoid"], [215, 2, 1, "", "sign"], [216, 2, 1, "", "sin"], [217, 2, 1, "", "sinh"], [218, 2, 1, "", "softmax"], [219, 2, 1, "", "sort"], [220, 2, 1, "", "split"], [221, 2, 1, "", "sqrt"], [222, 2, 1, "", "square"], [223, 2, 1, "", "squeeze"], [224, 2, 1, "", "stack"], [225, 2, 1, "", "std"], [226, 2, 1, "", "stop_gradient"], [227, 2, 1, "", "stream"], [228, 2, 1, "", "subtract"], [229, 2, 1, "", "sum"], [230, 2, 1, "", "swapaxes"], [231, 2, 1, "", "synchronize"], [232, 2, 1, "", "take"], [233, 2, 1, "", "take_along_axis"], [234, 2, 1, "", "tan"], [235, 2, 1, "", "tanh"], [236, 2, 1, "", "tensordot"], [237, 2, 1, "", "tile"], [238, 2, 1, "", "topk"], [239, 2, 1, "", "transpose"], [240, 2, 1, "", "tri"], [241, 2, 1, "", "tril"], [242, 2, 1, "", "triu"], [243, 2, 1, "", "value_and_grad"], [244, 2, 1, "", "var"], [245, 2, 1, "", "vjp"], [246, 2, 1, "", "vmap"], [247, 2, 1, "", "where"], [248, 2, 1, "", "zeros"], [249, 2, 1, "", "zeros_like"]], "mlx.core.Device": [[8, 1, 1, "", "__init__"]], "mlx.core.Dtype": [[9, 1, 1, "", "__init__"]], "mlx.core.DtypeCategory": [[10, 1, 1, "", "__init__"]], "mlx.core.Stream": [[256, 1, 1, "", "__init__"]], "mlx.core.array": [[28, 3, 1, "", "T"], [27, 1, 1, "", "__init__"], [29, 1, 1, "", "abs"], [30, 1, 1, "", "all"], [31, 1, 1, "", "any"], [32, 1, 1, "", "argmax"], [33, 1, 1, "", "argmin"], [34, 1, 1, "", "astype"], [35, 3, 1, "", "at"], [36, 1, 1, "", "cos"], [37, 1, 1, "", "cummax"], [38, 1, 1, "", "cummin"], [39, 1, 1, "", "cumprod"], [40, 1, 1, "", "cumsum"], [41, 1, 1, "", "diag"], [42, 1, 1, "", "diagonal"], [43, 3, 1, "", "dtype"], [44, 1, 1, "", "exp"], [45, 1, 1, "", "flatten"], [46, 1, 1, "", "item"], [47, 3, 1, "", "itemsize"], [48, 1, 1, "", "log"], [49, 1, 1, "", "log10"], [50, 1, 1, "", "log1p"], [51, 1, 1, "", "log2"], [52, 1, 1, "", "logsumexp"], [53, 1, 1, "", "max"], [54, 1, 1, "", "mean"], [55, 1, 1, "", "min"], [56, 1, 1, "", "moveaxis"], [57, 3, 1, "", "nbytes"], [58, 3, 1, "", "ndim"], [59, 1, 1, "", "prod"], [60, 1, 1, "", "reciprocal"], [61, 1, 1, "", "reshape"], [62, 1, 1, "", "round"], [63, 1, 1, "", "rsqrt"], [64, 3, 1, "", "shape"], [65, 1, 1, "", "sin"], [66, 3, 1, "", "size"], [67, 1, 1, "", "split"], [68, 1, 1, "", "sqrt"], [69, 1, 1, "", "square"], [70, 1, 1, "", "squeeze"], [71, 1, 1, "", "sum"], [72, 1, 1, "", "swapaxes"], [73, 1, 1, "", "tolist"], [74, 1, 1, "", "transpose"], [75, 1, 1, "", "var"]], "mlx.core.fast": [[114, 2, 1, "", "layer_norm"], [115, 2, 1, "", "rms_norm"], [116, 2, 1, "", "rope"], [117, 2, 1, "", "scaled_dot_product_attention"]], "mlx.core.fft": [[118, 2, 1, "", "fft"], [119, 2, 1, "", "fft2"], [120, 2, 1, "", "fftn"], [121, 2, 1, "", "ifft"], [122, 2, 1, "", "ifft2"], [123, 2, 1, "", "ifftn"], [124, 2, 1, "", "irfft"], [125, 2, 1, "", "irfft2"], [126, 2, 1, "", "irfftn"], [127, 2, 1, "", "rfft"], [128, 2, 1, "", "rfft2"], [129, 2, 1, "", "rfftn"]], "mlx.core.linalg": [[148, 2, 1, "", "norm"], [149, 2, 1, "", "qr"]], "mlx.core.metal": [[166, 2, 1, "", "clear_cache"], [167, 2, 1, "", "get_active_memory"], [168, 2, 1, "", "get_cache_memory"], [169, 2, 1, "", "get_peak_memory"], [170, 2, 1, "", "is_available"], [171, 2, 1, "", "set_cache_limit"], [172, 2, 1, "", "set_memory_limit"], [173, 2, 1, "", "start_capture"], [174, 2, 1, "", "stop_capture"]], "mlx.core.random": [[191, 2, 1, "", "bernoulli"], [192, 2, 1, "", "categorical"], [193, 2, 1, "", "gumbel"], [194, 2, 1, "", "key"], [195, 2, 1, "", "multivariate_normal"], [196, 2, 1, "", "normal"], [197, 2, 1, "", "randint"], [198, 2, 1, "", "seed"], [199, 2, 1, "", "split"], [200, 2, 1, "", "truncated_normal"], [201, 2, 1, "", "uniform"]], "mlx.nn": [[265, 0, 1, "", "ALiBi"], [266, 0, 1, "", "AvgPool1d"], [267, 0, 1, "", "AvgPool2d"], [268, 0, 1, "", "BatchNorm"], [269, 0, 1, "", "Conv1d"], [270, 0, 1, "", "Conv2d"], [271, 0, 1, "", "Dropout"], [272, 0, 1, "", "Dropout2d"], [273, 0, 1, "", "Dropout3d"], [274, 0, 1, "", "Embedding"], [275, 0, 1, "", "GELU"], [276, 0, 1, "", "GRU"], [277, 0, 1, "", "GroupNorm"], [278, 0, 1, "", "InstanceNorm"], [279, 0, 1, "", "LSTM"], [280, 0, 1, "", "LayerNorm"], [281, 0, 1, "", "Linear"], [282, 0, 1, "", "MaxPool1d"], [283, 0, 1, "", "MaxPool2d"], [284, 0, 1, "", "Mish"], [368, 0, 1, "", "Module"], [305, 0, 1, "", "MultiHeadAttention"], [306, 0, 1, "", "PReLU"], [307, 0, 1, "", "QuantizedEmbedding"], [308, 0, 1, "", "QuantizedLinear"], [309, 0, 1, "", "RMSNorm"], [310, 0, 1, "", "RNN"], [311, 0, 1, "", "ReLU"], [312, 0, 1, "", "RoPE"], [313, 0, 1, "", "SELU"], [314, 0, 1, "", "Sequential"], [315, 0, 1, "", "SiLU"], [316, 0, 1, "", "SinusoidalPositionalEncoding"], [317, 0, 1, "", "Softshrink"], [318, 0, 1, "", "Step"], [319, 0, 1, "", "Transformer"], [320, 0, 1, "", "Upsample"], [329, 0, 1, "", "elu"], [330, 0, 1, "", "gelu"], [331, 0, 1, "", "gelu_approx"], [332, 0, 1, "", "gelu_fast_approx"], [333, 0, 1, "", "glu"], [334, 0, 1, "", "hardswish"], [335, 0, 1, "", "leaky_relu"], [336, 0, 1, "", "log_sigmoid"], [337, 0, 1, "", "log_softmax"], [352, 0, 1, "", "mish"], [353, 0, 1, "", "prelu"], [250, 2, 1, "", "quantize"], [354, 0, 1, "", "relu"], [355, 0, 1, "", "relu6"], [356, 0, 1, "", "selu"], [357, 0, 1, "", "sigmoid"], [358, 0, 1, "", "silu"], [359, 0, 1, "", "softmax"], [360, 0, 1, "", "softplus"], [361, 0, 1, "", "softshrink"], [362, 0, 1, "", "step"], [363, 0, 1, "", "tanh"], [251, 2, 1, "", "value_and_grad"]], "mlx.nn.Module": [[285, 1, 1, "", "apply"], [286, 1, 1, "", "apply_to_modules"], [287, 1, 1, "", "children"], [288, 1, 1, "", "eval"], [289, 1, 1, "", "filter_and_map"], [290, 1, 1, "", "freeze"], [291, 1, 1, "", "leaf_modules"], [292, 1, 1, "", "load_weights"], [293, 1, 1, "", "modules"], [294, 1, 1, "", "named_modules"], [295, 1, 1, "", "parameters"], [296, 1, 1, "", "save_weights"], [297, 1, 1, "", "set_dtype"], [298, 3, 1, "", "state"], [299, 1, 1, "", "train"], [300, 1, 1, "", "trainable_parameters"], [301, 3, 1, "", "training"], [302, 1, 1, "", "unfreeze"], [303, 1, 1, "", "update"], [304, 1, 1, "", "update_modules"]], "mlx.nn.init": [[321, 2, 1, "", "constant"], [322, 2, 1, "", "glorot_normal"], [323, 2, 1, "", "glorot_uniform"], [324, 2, 1, "", "he_normal"], [325, 2, 1, "", "he_uniform"], [326, 2, 1, "", "identity"], [327, 2, 1, "", "normal"], [328, 2, 1, "", "uniform"]], "mlx.nn.losses": [[338, 0, 1, "", "binary_cross_entropy"], [339, 0, 1, "", "cosine_similarity_loss"], [340, 0, 1, "", "cross_entropy"], [341, 0, 1, "", "gaussian_nll_loss"], [342, 0, 1, "", "hinge_loss"], [343, 0, 1, "", "huber_loss"], [344, 0, 1, "", "kl_div_loss"], [345, 0, 1, "", "l1_loss"], [346, 0, 1, "", "log_cosh_loss"], [347, 0, 1, "", "margin_ranking_loss"], [348, 0, 1, "", "mse_loss"], [349, 0, 1, "", "nll_loss"], [350, 0, 1, "", "smooth_l1_loss"], [351, 0, 1, "", "triplet_loss"]], "mlx.optimizers": [[371, 0, 1, "", "AdaDelta"], [372, 0, 1, "", "Adafactor"], [373, 0, 1, "", "Adagrad"], [374, 0, 1, "", "Adam"], [375, 0, 1, "", "AdamW"], [376, 0, 1, "", "Adamax"], [377, 0, 1, "", "Lion"], [390, 0, 1, "", "Optimizer"], [382, 0, 1, "", "RMSprop"], [383, 0, 1, "", "SGD"], [384, 2, 1, "", "cosine_decay"], [385, 2, 1, "", "exponential_decay"], [386, 2, 1, "", "join_schedules"], [387, 2, 1, "", "linear_schedule"], [388, 2, 1, "", "step_decay"]], "mlx.optimizers.Optimizer": [[378, 1, 1, "", "apply_gradients"], [379, 1, 1, "", "init"], [380, 3, 1, "", "state"], [381, 1, 1, "", "update"]], "mlx.utils": [[252, 2, 1, "", "tree_flatten"], [253, 2, 1, "", "tree_map"], [254, 2, 1, "", "tree_map_with_path"], [255, 2, 1, "", "tree_unflatten"]]}, "objtypes": {"0": "py:class", "1": "py:method", "2": "py:function", "3": "py:property"}, "objnames": {"0": ["py", "class", "Python class"], "1": ["py", "method", "Python method"], "2": ["py", "function", "Python function"], "3": ["py", "property", "Python property"]}, "titleterms": {"oper": [0, 1, 369], "develop": 1, "document": 1, "introduc": 1, "exampl": [1, 6, 395, 402], "primit": 1, "us": [1, 398, 403], "implement": [1, 4], "cpu": 1, "back": 1, "end": 1, "gpu": 1, "transform": [1, 319, 393, 395, 396, 398, 400], "build": [1, 7], "bind": 1, "python": [1, 6, 7], "cmake": 1, "setuptool": 1, "usag": [1, 6], "result": 1, "script": [1, 4], "download": [1, 4], "code": [1, 4], "metal": [2, 7, 166, 167, 168, 169, 170, 171, 172, 173, 174, 263], "debugg": 2, "xcode": 2, "workflow": 2, "linear": [3, 262, 281], "regress": 3, "llm": 4, "infer": 4, "model": 4, "attent": 4, "layer": [4, 5, 366], "encod": 4, "full": [4, 133], "gener": 4, "put": 4, "all": [4, 13, 30], "togeth": 4, "convert": 4, "weight": 4, "load": [4, 151, 401], "benchmark": 4, "multi": 5, "perceptron": 5, "mlx": [6, 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, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388], "instal": [6, 7], "api": [6, 7], "refer": 6, "c": [6, 7], "further": 6, "read": 6, "troubleshoot": 7, "from": [7, 397], "sourc": 7, "requir": 7, "option": 7, "found": 7, "x86": 7, "shell": 7, "core": [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, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 256], "devic": [8, 259], "dtype": [9, 43], "dtypecategori": 10, "ab": [11, 29], "add": 12, "allclos": 14, "ani": [15, 31], "arang": 16, "arcco": 17, "arccosh": 18, "arcsin": 19, "arcsinh": 20, "arctan": 21, "arctanh": 22, "argmax": [23, 32], "argmin": [24, 33], "argpartit": 25, "argsort": 26, "arrai": [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, 257, 397, 401], "t": 28, "astyp": 34, "co": [36, 90], "cummax": [37, 92], "cummin": [38, 93], "cumprod": [39, 94], "cumsum": [40, 95], "diag": [41, 100], "diagon": [42, 101], "exp": [44, 110], "flatten": [45, 130], "item": 46, "items": 47, "log": [48, 152], "log10": [49, 153], "log1p": [50, 154], "log2": [51, 155], "logsumexp": [52, 160], "max": [53, 162], "mean": [54, 164], "min": [55, 175], "moveaxi": [56, 177], "nbyte": 57, "ndim": 58, "prod": [59, 187], "reciproc": [60, 202], "reshap": [61, 204], "round": [62, 205], "rsqrt": [63, 206], "shape": 64, "sin": [65, 216], "size": 66, "split": [67, 199, 220], "sqrt": [68, 221], "squar": [69, 222], "squeez": [70, 223], "sum": [71, 229], "swapax": [72, 230], "tolist": 73, "transpos": [74, 239], "var": [75, 244], "array_equ": 76, "atleast_1d": 77, "atleast_2d": 78, "atleast_3d": 79, "block_masked_mm": 80, "broadcast_to": 81, "ceil": 82, "clip": 83, "compil": [84, 395], "concaten": 85, "conv1d": [86, 269], "conv2d": [87, 270], "conv_gener": 88, "convolv": 89, "cosh": 91, "default_devic": 96, "default_stream": 97, "degre": 98, "dequant": 99, "disable_compil": 102, "divid": 103, "divmod": 104, "enable_compil": 105, "equal": 106, "erf": 107, "erfinv": 108, "eval": [109, 288], "expand_dim": 111, "expm1": 112, "ey": 113, "fast": [114, 115, 116, 117, 260], "layer_norm": 114, "rms_norm": 115, "rope": [116, 312], "scaled_dot_product_attent": 117, "fft": [118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 261], "fft2": 119, "fftn": 120, "ifft": 121, "ifft2": 122, "ifftn": 123, "irfft": 124, "irfft2": 125, "irfftn": 126, "rfft": 127, "rfft2": 128, "rfftn": 129, "floor": 131, "floor_divid": 132, "grad": [134, 264], "greater": 135, "greater_equ": 136, "ident": [137, 326], "inner": 138, "isclos": 139, "isinf": 140, "isnan": 141, "isneginf": 142, "isposinf": 143, "issubdtyp": 144, "jvp": 145, "less": 146, "less_equ": 147, "linalg": [148, 149], "norm": 148, "qr": 149, "linspac": 150, "logaddexp": 156, "logical_and": 157, "logical_not": 158, "logical_or": 159, "matmul": 161, "maximum": 163, "meshgrid": 165, "clear_cach": 166, "get_active_memori": 167, "get_cache_memori": 168, "get_peak_memori": 169, "is_avail": 170, "set_cache_limit": 171, "set_memory_limit": 172, "start_captur": 173, "stop_captur": 174, "minimum": 176, "multipli": 178, "neg": 179, "new_stream": 180, "not_equ": 181, "ones": 182, "ones_lik": 183, "outer": 184, "pad": 185, "partit": 186, "quantiz": [188, 250], "quantized_matmul": 189, "radian": 190, "random": [191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 392], "bernoulli": 191, "categor": 192, "gumbel": 193, "kei": 194, "multivariate_norm": 195, "normal": [196, 327], "randint": 197, "seed": 198, "truncated_norm": 200, "uniform": [201, 328], "repeat": 203, "save": [207, 401], "save_gguf": 208, "save_safetensor": 209, "savez": 210, "savez_compress": 211, "set_default_devic": 212, "set_default_stream": 213, "sigmoid": [214, 357], "sign": 215, "sinh": 217, "softmax": [218, 359], "sort": 219, "stack": 224, "std": 225, "stop_gradi": 226, "stream": [227, 256, 259, 403], "subtract": 228, "synchron": 231, "take": 232, "take_along_axi": 233, "tan": 234, "tanh": [235, 363], "tensordot": 236, "tile": 237, "topk": 238, "tri": 240, "tril": 241, "triu": 242, "value_and_grad": [243, 251], "vjp": 245, "vmap": 246, "where": 247, "zero": 248, "zeros_lik": 249, "nn": [250, 251, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363], "util": [252, 253, 254, 255, 394], "tree_flatten": 252, "tree_map": 253, "tree_map_with_path": 254, "tree_unflatten": 255, "data": 258, "type": 258, "support": 258, "algebra": 262, "neural": 264, "network": 264, "quick": [264, 400], "start": [264, 400], "The": 264, "modul": [264, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 368], "class": 264, "paramet": [264, 295], "updat": [264, 303, 381, 397], "inspect": 264, "valu": 264, "alibi": 265, "avgpool1d": 266, "avgpool2d": 267, "batchnorm": 268, "dropout": 271, "dropout2d": 272, "dropout3d": 273, "embed": 274, "gelu": [275, 330], "gru": 276, "groupnorm": 277, "instancenorm": 278, "lstm": 279, "layernorm": 280, "maxpool1d": 282, "maxpool2d": 283, "mish": [284, 352], "appli": 285, "apply_to_modul": 286, "children": 287, "filter_and_map": 289, "freez": 290, "leaf_modul": 291, "load_weight": 292, "named_modul": 294, "save_weight": 296, "set_dtyp": 297, "state": [298, 380], "train": [299, 301, 395], "trainable_paramet": 300, "unfreez": 302, "update_modul": 304, "multiheadattent": 305, "prelu": [306, 353], "quantizedembed": 307, "quantizedlinear": 308, "rmsnorm": 309, "rnn": 310, "relu": [311, 354], "selu": [313, 356], "sequenti": 314, "silu": [315, 358], "sinusoidalpositionalencod": 316, "softshrink": [317, 361], "step": [318, 362], "upsampl": 320, "init": [321, 322, 323, 324, 325, 326, 327, 328, 379], "constant": 321, "glorot_norm": 322, "glorot_uniform": 323, "he_norm": 324, "he_uniform": 325, "elu": 329, "gelu_approx": 331, "gelu_fast_approx": 332, "glu": 333, "hardswish": 334, "leaky_relu": 335, "log_sigmoid": 336, "log_softmax": 337, "loss": [338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 367], "binary_cross_entropi": 338, "cosine_similarity_loss": 339, "cross_entropi": 340, "gaussian_nll_loss": 341, "hinge_loss": 342, "huber_loss": 343, "kl_div_loss": 344, "l1_loss": 345, "log_cosh_loss": 346, "margin_ranking_loss": 347, "mse_loss": 348, "nll_loss": 349, "smooth_l1_loss": 350, "triplet_loss": 351, "relu6": 355, "softplu": 360, "function": [364, 367, 395, 396, 400], "initi": 365, "optim": [370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390], "adadelta": 371, "adafactor": 372, "adagrad": 373, "adam": 374, "adamw": 375, "adamax": 376, "lion": 377, "apply_gradi": 378, "rmsprop": 382, "sgd": 383, "cosine_decai": 384, "exponential_decai": 385, "join_schedul": 386, "linear_schedul": 387, "step_decai": 388, "common": 389, "schedul": 391, "tree": 394, "basic": [395, 400], "speedup": 395, "debug": 395, "pure": 395, "graph": [395, 398, 400], "automat": 396, "differenti": 396, "vector": 396, "index": 397, "differ": 397, "numpi": [397, 399], "In": 397, "place": 397, "lazi": 398, "evalu": 398, "why": 398, "comput": 398, "onli": 398, "what": 398, "you": 398, "when": 398, "convers": 399, "other": 399, "framework": 399, "pytorch": 399, "jax": 399, "tensorflow": 399, "guid": 400, "serial": 401, "format": 401, "unifi": 402, "memori": 402, "A": 402, "simpl": 402, "specifi": 403}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx": 60}, "alltitles": {"Operations": [[0, "operations"], [1, "operations"], [369, "operations"]], "Developer Documentation": [[1, "developer-documentation"]], "Introducing the Example": [[1, "introducing-the-example"]], "Operations and Primitives": [[1, "operations-and-primitives"]], "Primitives": [[1, "primitives"]], "Using the Primitive": [[1, "using-the-primitive"]], "Implementing the Primitive": [[1, "implementing-the-primitive"]], "Implementing the CPU Back-end": [[1, "implementing-the-cpu-back-end"]], "Implementing the GPU Back-end": [[1, "implementing-the-gpu-back-end"]], "Primitive Transforms": [[1, "primitive-transforms"]], "Building and Binding": [[1, "building-and-binding"]], "Binding to Python": [[1, "binding-to-python"]], "Building with CMake": [[1, "building-with-cmake"]], "Building with setuptools": [[1, "building-with-setuptools"]], "Usage": [[1, "usage"], [6, null]], "Results": [[1, "results"]], "Scripts": [[1, "scripts"], [4, "scripts"]], "Download the code": [[1, null], [4, null]], "Metal Debugger": [[2, "metal-debugger"]], "Xcode Workflow": [[2, "xcode-workflow"]], "Linear Regression": [[3, "linear-regression"]], "LLM inference": [[4, "llm-inference"]], "Implementing the model": [[4, "implementing-the-model"]], "Attention layer": [[4, "attention-layer"]], "Encoder layer": [[4, "encoder-layer"]], "Full model": [[4, "full-model"]], "Generation": [[4, "generation"]], "Putting it all together": [[4, "putting-it-all-together"]], "Converting the weights": [[4, "converting-the-weights"]], "Weight loading and benchmarking": [[4, "weight-loading-and-benchmarking"]], "Multi-Layer Perceptron": [[5, "multi-layer-perceptron"]], "MLX": [[6, "mlx"]], "Install": [[6, null]], "Examples": [[6, null]], "Python API Reference": [[6, null]], "C++ API Reference": [[6, null]], "Further Reading": [[6, null]], "Build and Install": [[7, "build-and-install"]], "Python Installation": [[7, "python-installation"]], "Troubleshooting": [[7, "troubleshooting"], [7, "id2"]], "Build from source": [[7, "build-from-source"]], "Build Requirements": [[7, "build-requirements"]], "Python API": [[7, "python-api"]], "C++ API": [[7, "c-api"]], "Build Options": [[7, "id3"]], "Metal not found": [[7, "metal-not-found"]], "x86 Shell": [[7, "x86-shell"]], "mlx.core.fast.layer_norm": [[114, "mlx-core-fast-layer-norm"]], "mlx.core.fast.rms_norm": [[115, "mlx-core-fast-rms-norm"]], "mlx.core.fast.rope": [[116, "mlx-core-fast-rope"]], "mlx.core.fast.scaled_dot_product_attention": [[117, "mlx-core-fast-scaled-dot-product-attention"]], "mlx.core.fft.fft": [[118, "mlx-core-fft-fft"]], "mlx.core.fft.fft2": [[119, "mlx-core-fft-fft2"]], "mlx.core.fft.fftn": [[120, "mlx-core-fft-fftn"]], "mlx.core.fft.ifft": [[121, "mlx-core-fft-ifft"]], "mlx.core.fft.ifft2": [[122, "mlx-core-fft-ifft2"]], "mlx.core.fft.ifftn": [[123, "mlx-core-fft-ifftn"]], "mlx.core.fft.irfft": [[124, "mlx-core-fft-irfft"]], "mlx.core.fft.irfft2": [[125, "mlx-core-fft-irfft2"]], "mlx.core.fft.irfftn": [[126, "mlx-core-fft-irfftn"]], "mlx.core.fft.rfft": [[127, "mlx-core-fft-rfft"]], "mlx.core.fft.rfft2": [[128, "mlx-core-fft-rfft2"]], "mlx.core.fft.rfftn": [[129, "mlx-core-fft-rfftn"]], "mlx.core.linalg.norm": [[148, "mlx-core-linalg-norm"]], "mlx.core.linalg.qr": [[149, "mlx-core-linalg-qr"]], "mlx.core.metal.clear_cache": [[166, "mlx-core-metal-clear-cache"]], "mlx.core.metal.get_active_memory": [[167, "mlx-core-metal-get-active-memory"]], "mlx.core.metal.get_cache_memory": [[168, "mlx-core-metal-get-cache-memory"]], "mlx.core.metal.get_peak_memory": [[169, "mlx-core-metal-get-peak-memory"]], "mlx.core.metal.is_available": [[170, "mlx-core-metal-is-available"]], "mlx.core.metal.set_cache_limit": [[171, "mlx-core-metal-set-cache-limit"]], "mlx.core.metal.set_memory_limit": [[172, "mlx-core-metal-set-memory-limit"]], "mlx.core.metal.start_capture": [[173, "mlx-core-metal-start-capture"]], "mlx.core.metal.stop_capture": [[174, "mlx-core-metal-stop-capture"]], "mlx.core.random.bernoulli": [[191, "mlx-core-random-bernoulli"]], "mlx.core.random.categorical": [[192, "mlx-core-random-categorical"]], "mlx.core.random.gumbel": [[193, "mlx-core-random-gumbel"]], "mlx.core.random.key": [[194, "mlx-core-random-key"]], "mlx.core.random.multivariate_normal": [[195, "mlx-core-random-multivariate-normal"]], "mlx.core.random.normal": [[196, "mlx-core-random-normal"]], "mlx.core.random.randint": [[197, "mlx-core-random-randint"]], "mlx.core.random.seed": [[198, "mlx-core-random-seed"]], "mlx.core.random.split": [[199, "mlx-core-random-split"]], "mlx.core.random.truncated_normal": [[200, "mlx-core-random-truncated-normal"]], "mlx.core.random.uniform": [[201, "mlx-core-random-uniform"]], "mlx.nn.quantize": [[250, "mlx-nn-quantize"]], "mlx.nn.value_and_grad": [[251, "mlx-nn-value-and-grad"]], "mlx.utils.tree_flatten": [[252, "mlx-utils-tree-flatten"]], "mlx.utils.tree_map": [[253, "mlx-utils-tree-map"]], "mlx.utils.tree_map_with_path": [[254, "mlx-utils-tree-map-with-path"]], "mlx.utils.tree_unflatten": [[255, "mlx-utils-tree-unflatten"]], "Array": [[257, "array"]], "Data Types": [[258, "data-types"]], "Supported Data Types": [[258, "id2"]], "Devices and Streams": [[259, "devices-and-streams"]], "Fast": [[260, "fast"]], "FFT": [[261, "fft"]], "Linear Algebra": [[262, "linear-algebra"]], "Metal": [[263, "metal"]], "Neural Networks": [[264, "neural-networks"]], "Quick Start with Neural Networks": [[264, "quick-start-with-neural-networks"]], "The Module Class": [[264, "the-module-class"]], "Parameters": [[264, "parameters"]], "Updating the Parameters": [[264, "updating-the-parameters"]], "Inspecting Modules": [[264, "inspecting-modules"]], "Value and Grad": [[264, "value-and-grad"]], "mlx.nn.ALiBi": [[265, "mlx-nn-alibi"]], "mlx.nn.AvgPool1d": [[266, "mlx-nn-avgpool1d"]], "mlx.nn.AvgPool2d": [[267, "mlx-nn-avgpool2d"]], "mlx.nn.BatchNorm": [[268, "mlx-nn-batchnorm"]], "mlx.nn.Conv1d": [[269, "mlx-nn-conv1d"]], "mlx.nn.Conv2d": [[270, "mlx-nn-conv2d"]], "mlx.nn.Dropout": [[271, "mlx-nn-dropout"]], "mlx.nn.Dropout2d": [[272, "mlx-nn-dropout2d"]], "mlx.nn.Dropout3d": [[273, "mlx-nn-dropout3d"]], "mlx.nn.Embedding": [[274, "mlx-nn-embedding"]], "mlx.nn.GELU": [[275, "mlx-nn-gelu"]], "mlx.nn.GRU": [[276, "mlx-nn-gru"]], "mlx.nn.GroupNorm": [[277, "mlx-nn-groupnorm"]], "mlx.nn.InstanceNorm": [[278, "mlx-nn-instancenorm"]], "mlx.nn.LSTM": [[279, "mlx-nn-lstm"]], "mlx.nn.LayerNorm": [[280, "mlx-nn-layernorm"]], "mlx.nn.Linear": [[281, "mlx-nn-linear"]], "mlx.nn.MaxPool1d": [[282, "mlx-nn-maxpool1d"]], "mlx.nn.MaxPool2d": [[283, "mlx-nn-maxpool2d"]], "mlx.nn.Mish": [[284, "mlx-nn-mish"]], "mlx.nn.Module.apply": [[285, "mlx-nn-module-apply"]], "mlx.nn.Module.apply_to_modules": [[286, "mlx-nn-module-apply-to-modules"]], "mlx.nn.Module.children": [[287, "mlx-nn-module-children"]], "mlx.nn.Module.eval": [[288, "mlx-nn-module-eval"]], "mlx.nn.Module.filter_and_map": [[289, "mlx-nn-module-filter-and-map"]], "mlx.nn.Module.freeze": [[290, "mlx-nn-module-freeze"]], "mlx.nn.Module.leaf_modules": [[291, "mlx-nn-module-leaf-modules"]], "mlx.nn.Module.load_weights": [[292, "mlx-nn-module-load-weights"]], "mlx.nn.Module.modules": [[293, "mlx-nn-module-modules"]], "mlx.nn.Module.named_modules": [[294, "mlx-nn-module-named-modules"]], "mlx.nn.Module.parameters": [[295, "mlx-nn-module-parameters"]], "mlx.nn.Module.save_weights": [[296, "mlx-nn-module-save-weights"]], "mlx.nn.Module.set_dtype": [[297, "mlx-nn-module-set-dtype"]], "mlx.nn.Module.state": [[298, "mlx-nn-module-state"]], "mlx.nn.Module.train": [[299, "mlx-nn-module-train"]], "mlx.nn.Module.trainable_parameters": [[300, "mlx-nn-module-trainable-parameters"]], "mlx.nn.Module.training": [[301, "mlx-nn-module-training"]], "mlx.nn.Module.unfreeze": [[302, "mlx-nn-module-unfreeze"]], "mlx.nn.Module.update": [[303, "mlx-nn-module-update"]], "mlx.nn.Module.update_modules": [[304, "mlx-nn-module-update-modules"]], "mlx.nn.MultiHeadAttention": [[305, "mlx-nn-multiheadattention"]], "mlx.nn.PReLU": [[306, "mlx-nn-prelu"]], "mlx.nn.QuantizedEmbedding": [[307, "mlx-nn-quantizedembedding"]], "mlx.nn.QuantizedLinear": [[308, "mlx-nn-quantizedlinear"]], "mlx.nn.RMSNorm": [[309, "mlx-nn-rmsnorm"]], "mlx.nn.RNN": [[310, "mlx-nn-rnn"]], "mlx.nn.ReLU": [[311, "mlx-nn-relu"]], "mlx.nn.RoPE": [[312, "mlx-nn-rope"]], "mlx.nn.SELU": [[313, "mlx-nn-selu"]], "mlx.nn.Sequential": [[314, "mlx-nn-sequential"]], "mlx.nn.SiLU": [[315, "mlx-nn-silu"]], "mlx.nn.SinusoidalPositionalEncoding": [[316, "mlx-nn-sinusoidalpositionalencoding"]], "mlx.nn.Softshrink": [[317, "mlx-nn-softshrink"]], "mlx.nn.Step": [[318, "mlx-nn-step"]], "mlx.nn.Transformer": [[319, "mlx-nn-transformer"]], "mlx.nn.Upsample": [[320, "mlx-nn-upsample"]], "mlx.nn.init.constant": [[321, "mlx-nn-init-constant"]], "mlx.nn.init.glorot_normal": [[322, "mlx-nn-init-glorot-normal"]], "mlx.nn.init.glorot_uniform": [[323, "mlx-nn-init-glorot-uniform"]], "mlx.nn.init.he_normal": [[324, "mlx-nn-init-he-normal"]], "mlx.nn.init.he_uniform": [[325, "mlx-nn-init-he-uniform"]], "mlx.nn.init.identity": [[326, "mlx-nn-init-identity"]], "mlx.nn.init.normal": [[327, "mlx-nn-init-normal"]], "mlx.nn.init.uniform": [[328, "mlx-nn-init-uniform"]], "mlx.nn.elu": [[329, "mlx-nn-elu"]], "mlx.nn.gelu": [[330, "mlx-nn-gelu"]], "mlx.nn.gelu_approx": [[331, "mlx-nn-gelu-approx"]], "mlx.nn.gelu_fast_approx": [[332, "mlx-nn-gelu-fast-approx"]], "mlx.nn.glu": [[333, "mlx-nn-glu"]], "mlx.nn.hardswish": [[334, "mlx-nn-hardswish"]], "mlx.nn.leaky_relu": [[335, "mlx-nn-leaky-relu"]], "mlx.nn.log_sigmoid": [[336, "mlx-nn-log-sigmoid"]], "mlx.nn.log_softmax": [[337, "mlx-nn-log-softmax"]], "mlx.nn.losses.binary_cross_entropy": [[338, "mlx-nn-losses-binary-cross-entropy"]], "mlx.nn.losses.cosine_similarity_loss": [[339, "mlx-nn-losses-cosine-similarity-loss"]], "mlx.nn.losses.cross_entropy": [[340, "mlx-nn-losses-cross-entropy"]], "mlx.nn.losses.gaussian_nll_loss": [[341, "mlx-nn-losses-gaussian-nll-loss"]], "mlx.nn.losses.hinge_loss": [[342, "mlx-nn-losses-hinge-loss"]], "mlx.nn.losses.huber_loss": [[343, "mlx-nn-losses-huber-loss"]], "mlx.nn.losses.kl_div_loss": [[344, "mlx-nn-losses-kl-div-loss"]], "mlx.nn.losses.l1_loss": [[345, "mlx-nn-losses-l1-loss"]], "mlx.nn.losses.log_cosh_loss": [[346, "mlx-nn-losses-log-cosh-loss"]], "mlx.nn.losses.margin_ranking_loss": [[347, "mlx-nn-losses-margin-ranking-loss"]], "mlx.nn.losses.mse_loss": [[348, "mlx-nn-losses-mse-loss"]], "mlx.nn.losses.nll_loss": [[349, "mlx-nn-losses-nll-loss"]], "mlx.nn.losses.smooth_l1_loss": [[350, "mlx-nn-losses-smooth-l1-loss"]], "mlx.nn.losses.triplet_loss": [[351, "mlx-nn-losses-triplet-loss"]], "mlx.nn.mish": [[352, "mlx-nn-mish"]], "mlx.nn.prelu": [[353, "mlx-nn-prelu"]], "mlx.nn.relu": [[354, "mlx-nn-relu"]], "mlx.nn.relu6": [[355, "mlx-nn-relu6"]], "mlx.nn.selu": [[356, "mlx-nn-selu"]], "mlx.nn.sigmoid": [[357, "mlx-nn-sigmoid"]], "mlx.nn.silu": [[358, "mlx-nn-silu"]], "mlx.nn.softmax": [[359, "mlx-nn-softmax"]], "mlx.nn.softplus": [[360, "mlx-nn-softplus"]], "mlx.nn.softshrink": [[361, "mlx-nn-softshrink"]], "mlx.nn.step": [[362, "mlx-nn-step"]], "mlx.nn.tanh": [[363, "mlx-nn-tanh"]], "Functions": [[364, "functions"]], "Initializers": [[365, "initializers"]], "Layers": [[366, "layers"]], "Loss Functions": [[367, "loss-functions"]], "Module": [[368, "module"]], "Optimizers": [[370, "optimizers"]], "mlx.optimizers.AdaDelta": [[371, "mlx-optimizers-adadelta"]], "mlx.optimizers.Adafactor": [[372, "mlx-optimizers-adafactor"]], "mlx.optimizers.Adagrad": [[373, "mlx-optimizers-adagrad"]], "mlx.optimizers.Adam": [[374, "mlx-optimizers-adam"]], "mlx.optimizers.AdamW": [[375, "mlx-optimizers-adamw"]], "mlx.optimizers.Adamax": [[376, "mlx-optimizers-adamax"]], "mlx.optimizers.Lion": [[377, "mlx-optimizers-lion"]], "mlx.optimizers.Optimizer.apply_gradients": [[378, "mlx-optimizers-optimizer-apply-gradients"]], "mlx.optimizers.Optimizer.init": [[379, "mlx-optimizers-optimizer-init"]], "mlx.optimizers.Optimizer.state": [[380, "mlx-optimizers-optimizer-state"]], "mlx.optimizers.Optimizer.update": [[381, "mlx-optimizers-optimizer-update"]], "mlx.optimizers.RMSprop": [[382, "mlx-optimizers-rmsprop"]], "mlx.optimizers.SGD": [[383, "mlx-optimizers-sgd"]], "mlx.optimizers.cosine_decay": [[384, "mlx-optimizers-cosine-decay"]], "mlx.optimizers.exponential_decay": [[385, "mlx-optimizers-exponential-decay"]], "mlx.optimizers.join_schedules": [[386, "mlx-optimizers-join-schedules"]], "mlx.optimizers.linear_schedule": [[387, "mlx-optimizers-linear-schedule"]], "mlx.optimizers.step_decay": [[388, "mlx-optimizers-step-decay"]], "Common Optimizers": [[389, "common-optimizers"]], "Optimizer": [[390, "optimizer"]], "Schedulers": [[391, "schedulers"]], "Random": [[392, "random"]], "Transforms": [[393, "transforms"]], "Tree Utils": [[394, "tree-utils"]], "Compilation": [[395, "compilation"]], "Basics of Compile": [[395, "basics-of-compile"]], "Example Speedup": [[395, "example-speedup"]], "Debugging": [[395, "debugging"]], "Pure Functions": [[395, "pure-functions"]], "Compiling Training Graphs": [[395, "compiling-training-graphs"]], "Transformations with Compile": [[395, "transformations-with-compile"]], "Function Transforms": [[396, "function-transforms"]], "Automatic Differentiation": [[396, "automatic-differentiation"]], "Automatic Vectorization": [[396, "automatic-vectorization"]], "Indexing Arrays": [[397, "indexing-arrays"]], "Differences from NumPy": [[397, "differences-from-numpy"]], "In Place Updates": [[397, "in-place-updates"]], "Lazy Evaluation": [[398, "lazy-evaluation"]], "Why Lazy Evaluation": [[398, "why-lazy-evaluation"]], "Transforming Compute Graphs": [[398, "transforming-compute-graphs"]], "Only Compute What You Use": [[398, "only-compute-what-you-use"]], "When to Evaluate": [[398, "when-to-evaluate"]], "Conversion to NumPy and Other Frameworks": [[399, "conversion-to-numpy-and-other-frameworks"]], "PyTorch": [[399, "pytorch"]], "JAX": [[399, "jax"]], "TensorFlow": [[399, "tensorflow"]], "Quick Start Guide": [[400, "quick-start-guide"]], "Basics": [[400, "basics"]], "Function and Graph Transformations": [[400, "function-and-graph-transformations"]], "Saving and Loading Arrays": [[401, "saving-and-loading-arrays"]], "Serialization Formats": [[401, "id1"]], "Unified Memory": [[402, "unified-memory"]], "A Simple Example": [[402, "a-simple-example"]], "Using Streams": [[403, "using-streams"]], "Specifying the Stream": [[403, "specifying-the-stream"]], "mlx.core.Device": [[8, "mlx-core-device"]], "mlx.core.Dtype": [[9, "mlx-core-dtype"]], "mlx.core.DtypeCategory": [[10, "mlx-core-dtypecategory"]], "mlx.core.abs": [[11, "mlx-core-abs"]], "mlx.core.add": [[12, "mlx-core-add"]], "mlx.core.all": [[13, "mlx-core-all"]], "mlx.core.allclose": [[14, "mlx-core-allclose"]], "mlx.core.any": [[15, "mlx-core-any"]], "mlx.core.arange": [[16, "mlx-core-arange"]], "mlx.core.arccos": [[17, "mlx-core-arccos"]], "mlx.core.arccosh": [[18, "mlx-core-arccosh"]], "mlx.core.arcsin": [[19, "mlx-core-arcsin"]], "mlx.core.arcsinh": [[20, "mlx-core-arcsinh"]], "mlx.core.arctan": [[21, "mlx-core-arctan"]], "mlx.core.arctanh": [[22, "mlx-core-arctanh"]], "mlx.core.argmax": [[23, "mlx-core-argmax"]], "mlx.core.argmin": [[24, "mlx-core-argmin"]], "mlx.core.argpartition": [[25, "mlx-core-argpartition"]], "mlx.core.argsort": [[26, "mlx-core-argsort"]], "mlx.core.array": [[27, "mlx-core-array"]], "mlx.core.array.T": [[28, "mlx-core-array-t"]], "mlx.core.array.abs": [[29, "mlx-core-array-abs"]], "mlx.core.array.all": [[30, "mlx-core-array-all"]], "mlx.core.array.any": [[31, "mlx-core-array-any"]], "mlx.core.array.argmax": [[32, "mlx-core-array-argmax"]], "mlx.core.array.argmin": [[33, "mlx-core-array-argmin"]], "mlx.core.array.astype": [[34, "mlx-core-array-astype"]], "mlx.core.array.at": [[35, "mlx-core-array-at"]], "mlx.core.array.cos": [[36, "mlx-core-array-cos"]], "mlx.core.array.cummax": [[37, "mlx-core-array-cummax"]], "mlx.core.array.cummin": [[38, "mlx-core-array-cummin"]], "mlx.core.array.cumprod": [[39, "mlx-core-array-cumprod"]], "mlx.core.array.cumsum": [[40, "mlx-core-array-cumsum"]], "mlx.core.array.diag": [[41, "mlx-core-array-diag"]], "mlx.core.array.diagonal": [[42, "mlx-core-array-diagonal"]], "mlx.core.array.dtype": [[43, "mlx-core-array-dtype"]], "mlx.core.array.exp": [[44, "mlx-core-array-exp"]], "mlx.core.array.flatten": [[45, "mlx-core-array-flatten"]], "mlx.core.array.item": [[46, "mlx-core-array-item"]], "mlx.core.array.itemsize": [[47, "mlx-core-array-itemsize"]], "mlx.core.array.log": [[48, "mlx-core-array-log"]], "mlx.core.array.log10": [[49, "mlx-core-array-log10"]], "mlx.core.array.log1p": [[50, "mlx-core-array-log1p"]], "mlx.core.array.log2": [[51, "mlx-core-array-log2"]], "mlx.core.array.logsumexp": [[52, "mlx-core-array-logsumexp"]], "mlx.core.array.max": [[53, "mlx-core-array-max"]], "mlx.core.array.mean": [[54, "mlx-core-array-mean"]], "mlx.core.array.min": [[55, "mlx-core-array-min"]], "mlx.core.array.moveaxis": [[56, "mlx-core-array-moveaxis"]], "mlx.core.array.nbytes": [[57, "mlx-core-array-nbytes"]], "mlx.core.array.ndim": [[58, "mlx-core-array-ndim"]], "mlx.core.array.prod": [[59, "mlx-core-array-prod"]], "mlx.core.array.reciprocal": [[60, "mlx-core-array-reciprocal"]], "mlx.core.array.reshape": [[61, "mlx-core-array-reshape"]], "mlx.core.array.round": [[62, "mlx-core-array-round"]], "mlx.core.array.rsqrt": [[63, "mlx-core-array-rsqrt"]], "mlx.core.array.shape": [[64, "mlx-core-array-shape"]], "mlx.core.array.sin": [[65, "mlx-core-array-sin"]], "mlx.core.array.size": [[66, "mlx-core-array-size"]], "mlx.core.array.split": [[67, "mlx-core-array-split"]], "mlx.core.array.sqrt": [[68, "mlx-core-array-sqrt"]], "mlx.core.array.square": [[69, "mlx-core-array-square"]], "mlx.core.array.squeeze": [[70, "mlx-core-array-squeeze"]], "mlx.core.array.sum": [[71, "mlx-core-array-sum"]], "mlx.core.array.swapaxes": [[72, "mlx-core-array-swapaxes"]], "mlx.core.array.tolist": [[73, "mlx-core-array-tolist"]], "mlx.core.array.transpose": [[74, "mlx-core-array-transpose"]], "mlx.core.array.var": [[75, "mlx-core-array-var"]], "mlx.core.array_equal": [[76, "mlx-core-array-equal"]], "mlx.core.atleast_1d": [[77, "mlx-core-atleast-1d"]], "mlx.core.atleast_2d": [[78, "mlx-core-atleast-2d"]], "mlx.core.atleast_3d": [[79, "mlx-core-atleast-3d"]], "mlx.core.block_masked_mm": [[80, "mlx-core-block-masked-mm"]], "mlx.core.broadcast_to": [[81, "mlx-core-broadcast-to"]], "mlx.core.ceil": [[82, "mlx-core-ceil"]], "mlx.core.clip": [[83, "mlx-core-clip"]], "mlx.core.compile": [[84, "mlx-core-compile"]], "mlx.core.concatenate": [[85, "mlx-core-concatenate"]], "mlx.core.conv1d": [[86, "mlx-core-conv1d"]], "mlx.core.conv2d": [[87, "mlx-core-conv2d"]], "mlx.core.conv_general": [[88, "mlx-core-conv-general"]], "mlx.core.convolve": [[89, "mlx-core-convolve"]], "mlx.core.cos": [[90, "mlx-core-cos"]], "mlx.core.cosh": [[91, "mlx-core-cosh"]], "mlx.core.cummax": [[92, "mlx-core-cummax"]], "mlx.core.cummin": [[93, "mlx-core-cummin"]], "mlx.core.cumprod": [[94, "mlx-core-cumprod"]], "mlx.core.cumsum": [[95, "mlx-core-cumsum"]], "mlx.core.default_device": [[96, "mlx-core-default-device"]], "mlx.core.default_stream": [[97, "mlx-core-default-stream"]], "mlx.core.degrees": [[98, "mlx-core-degrees"]], "mlx.core.dequantize": [[99, "mlx-core-dequantize"]], "mlx.core.diag": [[100, "mlx-core-diag"]], "mlx.core.diagonal": [[101, "mlx-core-diagonal"]], "mlx.core.disable_compile": [[102, "mlx-core-disable-compile"]], "mlx.core.divide": [[103, "mlx-core-divide"]], "mlx.core.divmod": [[104, "mlx-core-divmod"]], "mlx.core.enable_compile": [[105, "mlx-core-enable-compile"]], "mlx.core.equal": [[106, "mlx-core-equal"]], "mlx.core.erf": [[107, "mlx-core-erf"]], "mlx.core.erfinv": [[108, "mlx-core-erfinv"]], "mlx.core.eval": [[109, "mlx-core-eval"]], "mlx.core.exp": [[110, "mlx-core-exp"]], "mlx.core.expand_dims": [[111, "mlx-core-expand-dims"]], "mlx.core.expm1": [[112, "mlx-core-expm1"]], "mlx.core.eye": [[113, "mlx-core-eye"]], "mlx.core.flatten": [[130, "mlx-core-flatten"]], "mlx.core.floor": [[131, "mlx-core-floor"]], "mlx.core.floor_divide": [[132, "mlx-core-floor-divide"]], "mlx.core.full": [[133, "mlx-core-full"]], "mlx.core.grad": [[134, "mlx-core-grad"]], "mlx.core.greater": [[135, "mlx-core-greater"]], "mlx.core.greater_equal": [[136, "mlx-core-greater-equal"]], "mlx.core.identity": [[137, "mlx-core-identity"]], "mlx.core.inner": [[138, "mlx-core-inner"]], "mlx.core.isclose": [[139, "mlx-core-isclose"]], "mlx.core.isinf": [[140, "mlx-core-isinf"]], "mlx.core.isnan": [[141, "mlx-core-isnan"]], "mlx.core.isneginf": [[142, "mlx-core-isneginf"]], "mlx.core.isposinf": [[143, "mlx-core-isposinf"]], "mlx.core.issubdtype": [[144, "mlx-core-issubdtype"]], "mlx.core.jvp": [[145, "mlx-core-jvp"]], "mlx.core.less": [[146, "mlx-core-less"]], "mlx.core.less_equal": [[147, "mlx-core-less-equal"]], "mlx.core.linspace": [[150, "mlx-core-linspace"]], "mlx.core.load": [[151, "mlx-core-load"]], "mlx.core.log": [[152, "mlx-core-log"]], "mlx.core.log10": [[153, "mlx-core-log10"]], "mlx.core.log1p": [[154, "mlx-core-log1p"]], "mlx.core.log2": [[155, "mlx-core-log2"]], "mlx.core.logaddexp": [[156, "mlx-core-logaddexp"]], "mlx.core.logical_and": [[157, "mlx-core-logical-and"]], "mlx.core.logical_not": [[158, "mlx-core-logical-not"]], "mlx.core.logical_or": [[159, "mlx-core-logical-or"]], "mlx.core.logsumexp": [[160, "mlx-core-logsumexp"]], "mlx.core.matmul": [[161, "mlx-core-matmul"]], "mlx.core.max": [[162, "mlx-core-max"]], "mlx.core.maximum": [[163, "mlx-core-maximum"]], "mlx.core.mean": [[164, "mlx-core-mean"]], "mlx.core.meshgrid": [[165, "mlx-core-meshgrid"]], "mlx.core.min": [[175, "mlx-core-min"]], "mlx.core.minimum": [[176, "mlx-core-minimum"]], "mlx.core.moveaxis": [[177, "mlx-core-moveaxis"]], "mlx.core.multiply": [[178, "mlx-core-multiply"]], "mlx.core.negative": [[179, "mlx-core-negative"]], "mlx.core.new_stream": [[180, "mlx-core-new-stream"]], "mlx.core.not_equal": [[181, "mlx-core-not-equal"]], "mlx.core.ones": [[182, "mlx-core-ones"]], "mlx.core.ones_like": [[183, "mlx-core-ones-like"]], "mlx.core.outer": [[184, "mlx-core-outer"]], "mlx.core.pad": [[185, "mlx-core-pad"]], "mlx.core.partition": [[186, "mlx-core-partition"]], "mlx.core.prod": [[187, "mlx-core-prod"]], "mlx.core.quantize": [[188, "mlx-core-quantize"]], "mlx.core.quantized_matmul": [[189, "mlx-core-quantized-matmul"]], "mlx.core.radians": [[190, "mlx-core-radians"]], "mlx.core.reciprocal": [[202, "mlx-core-reciprocal"]], "mlx.core.repeat": [[203, "mlx-core-repeat"]], "mlx.core.reshape": [[204, "mlx-core-reshape"]], "mlx.core.round": [[205, "mlx-core-round"]], "mlx.core.rsqrt": [[206, "mlx-core-rsqrt"]], "mlx.core.save": [[207, "mlx-core-save"]], "mlx.core.save_gguf": [[208, "mlx-core-save-gguf"]], "mlx.core.save_safetensors": [[209, "mlx-core-save-safetensors"]], "mlx.core.savez": [[210, "mlx-core-savez"]], "mlx.core.savez_compressed": [[211, "mlx-core-savez-compressed"]], "mlx.core.set_default_device": [[212, "mlx-core-set-default-device"]], "mlx.core.set_default_stream": [[213, "mlx-core-set-default-stream"]], "mlx.core.sigmoid": [[214, "mlx-core-sigmoid"]], "mlx.core.sign": [[215, "mlx-core-sign"]], "mlx.core.sin": [[216, "mlx-core-sin"]], "mlx.core.sinh": [[217, "mlx-core-sinh"]], "mlx.core.softmax": [[218, "mlx-core-softmax"]], "mlx.core.sort": [[219, "mlx-core-sort"]], "mlx.core.split": [[220, "mlx-core-split"]], "mlx.core.sqrt": [[221, "mlx-core-sqrt"]], "mlx.core.square": [[222, "mlx-core-square"]], "mlx.core.squeeze": [[223, "mlx-core-squeeze"]], "mlx.core.stack": [[224, "mlx-core-stack"]], "mlx.core.std": [[225, "mlx-core-std"]], "mlx.core.stop_gradient": [[226, "mlx-core-stop-gradient"]], "mlx.core.stream": [[227, "mlx-core-stream"]], "mlx.core.subtract": [[228, "mlx-core-subtract"]], "mlx.core.sum": [[229, "mlx-core-sum"]], "mlx.core.swapaxes": [[230, "mlx-core-swapaxes"]], "mlx.core.synchronize": [[231, "mlx-core-synchronize"]], "mlx.core.take": [[232, "mlx-core-take"]], "mlx.core.take_along_axis": [[233, "mlx-core-take-along-axis"]], "mlx.core.tan": [[234, "mlx-core-tan"]], "mlx.core.tanh": [[235, "mlx-core-tanh"]], "mlx.core.tensordot": [[236, "mlx-core-tensordot"]], "mlx.core.tile": [[237, "mlx-core-tile"]], "mlx.core.topk": [[238, "mlx-core-topk"]], "mlx.core.transpose": [[239, "mlx-core-transpose"]], "mlx.core.tri": [[240, "mlx-core-tri"]], "mlx.core.tril": [[241, "mlx-core-tril"]], "mlx.core.triu": [[242, "mlx-core-triu"]], "mlx.core.value_and_grad": [[243, "mlx-core-value-and-grad"]], "mlx.core.var": [[244, "mlx-core-var"]], "mlx.core.vjp": [[245, "mlx-core-vjp"]], "mlx.core.vmap": [[246, "mlx-core-vmap"]], "mlx.core.where": [[247, "mlx-core-where"]], "mlx.core.zeros": [[248, "mlx-core-zeros"]], "mlx.core.zeros_like": [[249, "mlx-core-zeros-like"]], "mlx.core.Stream": [[256, "mlx-core-stream"]]}, "indexentries": {"device (class in mlx.core)": [[8, "mlx.core.Device"]], "__init__() (device method)": [[8, "mlx.core.Device.__init__"]], "dtype (class in mlx.core)": [[9, "mlx.core.Dtype"]], "__init__() (dtype method)": [[9, "mlx.core.Dtype.__init__"]], "dtypecategory (class in mlx.core)": [[10, "mlx.core.DtypeCategory"]], "__init__() (dtypecategory method)": [[10, "mlx.core.DtypeCategory.__init__"]], "abs() (in module mlx.core)": [[11, "mlx.core.abs"]], "add() (in module mlx.core)": [[12, "mlx.core.add"]], "all() (in module mlx.core)": [[13, "mlx.core.all"]], "allclose() (in module mlx.core)": [[14, "mlx.core.allclose"]], "any() (in module mlx.core)": [[15, "mlx.core.any"]], "arange() (in module mlx.core)": [[16, "mlx.core.arange"]], "arccos() (in module mlx.core)": [[17, "mlx.core.arccos"]], "arccosh() (in module mlx.core)": [[18, "mlx.core.arccosh"]], "arcsin() (in module mlx.core)": [[19, "mlx.core.arcsin"]], "arcsinh() (in module mlx.core)": [[20, "mlx.core.arcsinh"]], "arctan() (in module mlx.core)": [[21, "mlx.core.arctan"]], "arctanh() (in module mlx.core)": [[22, "mlx.core.arctanh"]], "argmax() (in module mlx.core)": [[23, "mlx.core.argmax"]], "argmin() (in module mlx.core)": [[24, "mlx.core.argmin"]], "argpartition() (in module mlx.core)": [[25, "mlx.core.argpartition"]], "argsort() (in module mlx.core)": [[26, "mlx.core.argsort"]], "__init__() (array method)": [[27, "mlx.core.array.__init__"]], "array (class in mlx.core)": [[27, "mlx.core.array"]], "t (array property)": [[28, "mlx.core.array.T"]], "abs() (array method)": [[29, "mlx.core.array.abs"]], "all() (array method)": [[30, "mlx.core.array.all"]], "any() (array method)": [[31, "mlx.core.array.any"]], "argmax() (array method)": [[32, "mlx.core.array.argmax"]], "argmin() (array method)": [[33, "mlx.core.array.argmin"]], "astype() (array method)": [[34, "mlx.core.array.astype"]], "at (array property)": [[35, "mlx.core.array.at"]], "cos() (array method)": [[36, "mlx.core.array.cos"]], "cummax() (array method)": [[37, "mlx.core.array.cummax"]], "cummin() (array method)": [[38, "mlx.core.array.cummin"]], "cumprod() (array method)": [[39, "mlx.core.array.cumprod"]], "cumsum() (array method)": [[40, "mlx.core.array.cumsum"]], "diag() (array method)": [[41, "mlx.core.array.diag"]], "diagonal() (array method)": [[42, "mlx.core.array.diagonal"]], "dtype (array property)": [[43, "mlx.core.array.dtype"]], "exp() (array method)": [[44, "mlx.core.array.exp"]], "flatten() (array method)": [[45, "mlx.core.array.flatten"]], "item() (array method)": [[46, "mlx.core.array.item"]], "itemsize (array property)": [[47, "mlx.core.array.itemsize"]], "log() (array method)": [[48, "mlx.core.array.log"]], "log10() (array method)": [[49, "mlx.core.array.log10"]], "log1p() (array method)": [[50, "mlx.core.array.log1p"]], "log2() (array method)": [[51, "mlx.core.array.log2"]], "logsumexp() (array method)": [[52, "mlx.core.array.logsumexp"]], "max() (array method)": [[53, "mlx.core.array.max"]], "mean() (array method)": [[54, "mlx.core.array.mean"]], "min() (array method)": [[55, "mlx.core.array.min"]], "moveaxis() (array method)": [[56, "mlx.core.array.moveaxis"]], "nbytes (array property)": [[57, "mlx.core.array.nbytes"]], "ndim (array property)": [[58, "mlx.core.array.ndim"]], "prod() (array method)": [[59, "mlx.core.array.prod"]], "reciprocal() (array method)": [[60, "mlx.core.array.reciprocal"]], "reshape() (array method)": [[61, "mlx.core.array.reshape"]], "round() (array method)": [[62, "mlx.core.array.round"]], "rsqrt() (array method)": [[63, "mlx.core.array.rsqrt"]], "shape (array property)": [[64, "mlx.core.array.shape"]], "sin() (array method)": [[65, "mlx.core.array.sin"]], "size (array property)": [[66, "mlx.core.array.size"]], "split() (array method)": [[67, "mlx.core.array.split"]], "sqrt() (array method)": [[68, "mlx.core.array.sqrt"]], "square() (array method)": [[69, "mlx.core.array.square"]], "squeeze() (array method)": [[70, "mlx.core.array.squeeze"]], "sum() (array method)": [[71, "mlx.core.array.sum"]], "swapaxes() (array method)": [[72, "mlx.core.array.swapaxes"]], "tolist() (array method)": [[73, "mlx.core.array.tolist"]], "transpose() (array method)": [[74, "mlx.core.array.transpose"]], "var() (array method)": [[75, "mlx.core.array.var"]], "array_equal() (in module mlx.core)": [[76, "mlx.core.array_equal"]], "atleast_1d() (in module mlx.core)": [[77, "mlx.core.atleast_1d"]], "atleast_2d() (in module mlx.core)": [[78, "mlx.core.atleast_2d"]], "atleast_3d() (in module mlx.core)": [[79, "mlx.core.atleast_3d"]], "block_masked_mm() (in module mlx.core)": [[80, "mlx.core.block_masked_mm"]], "broadcast_to() (in module mlx.core)": [[81, "mlx.core.broadcast_to"]], "ceil() (in module mlx.core)": [[82, "mlx.core.ceil"]], "clip() (in module mlx.core)": [[83, "mlx.core.clip"]], "compile() (in module mlx.core)": [[84, "mlx.core.compile"]], "concatenate() (in module mlx.core)": [[85, "mlx.core.concatenate"]], "conv1d() (in module mlx.core)": [[86, "mlx.core.conv1d"]], "conv2d() (in module mlx.core)": [[87, "mlx.core.conv2d"]], "conv_general() (in module mlx.core)": [[88, "mlx.core.conv_general"]], "convolve() (in module mlx.core)": [[89, "mlx.core.convolve"]], "cos() (in module mlx.core)": [[90, "mlx.core.cos"]], "cosh() (in module mlx.core)": [[91, "mlx.core.cosh"]], "cummax() (in module mlx.core)": [[92, "mlx.core.cummax"]], "cummin() (in module mlx.core)": [[93, "mlx.core.cummin"]], "cumprod() (in module mlx.core)": [[94, "mlx.core.cumprod"]], "cumsum() (in module mlx.core)": [[95, "mlx.core.cumsum"]], "default_device() (in module mlx.core)": [[96, "mlx.core.default_device"]], "default_stream() (in module mlx.core)": [[97, "mlx.core.default_stream"]], "degrees() (in module mlx.core)": [[98, "mlx.core.degrees"]], "dequantize() (in module mlx.core)": [[99, "mlx.core.dequantize"]], "diag() (in module mlx.core)": [[100, "mlx.core.diag"]], "diagonal() (in module mlx.core)": [[101, "mlx.core.diagonal"]], "disable_compile() (in module mlx.core)": [[102, "mlx.core.disable_compile"]], "divide() (in module mlx.core)": [[103, "mlx.core.divide"]], "divmod() (in module mlx.core)": [[104, "mlx.core.divmod"]], "enable_compile() (in module mlx.core)": [[105, "mlx.core.enable_compile"]], "equal() (in module mlx.core)": [[106, "mlx.core.equal"]], "erf() (in module mlx.core)": [[107, "mlx.core.erf"]], "erfinv() (in module mlx.core)": [[108, "mlx.core.erfinv"]], "eval() (in module mlx.core)": [[109, "mlx.core.eval"]], "exp() (in module mlx.core)": [[110, "mlx.core.exp"]], "expand_dims() (in module mlx.core)": [[111, "mlx.core.expand_dims"]], "expm1() (in module mlx.core)": [[112, "mlx.core.expm1"]], "eye() (in module mlx.core)": [[113, "mlx.core.eye"]], "flatten() (in module mlx.core)": [[130, "mlx.core.flatten"]], "floor() (in module mlx.core)": [[131, "mlx.core.floor"]], "floor_divide() (in module mlx.core)": [[132, "mlx.core.floor_divide"]], "full() (in module mlx.core)": [[133, "mlx.core.full"]], "grad() (in module mlx.core)": [[134, "mlx.core.grad"]], "greater() (in module mlx.core)": [[135, "mlx.core.greater"]], "greater_equal() (in module mlx.core)": [[136, "mlx.core.greater_equal"]], "identity() (in module mlx.core)": [[137, "mlx.core.identity"]], "inner() (in module mlx.core)": [[138, "mlx.core.inner"]], "isclose() (in module mlx.core)": [[139, "mlx.core.isclose"]], "isinf() (in module mlx.core)": [[140, "mlx.core.isinf"]], "isnan() (in module mlx.core)": [[141, "mlx.core.isnan"]], "isneginf() (in module mlx.core)": [[142, "mlx.core.isneginf"]], "isposinf() (in module mlx.core)": [[143, "mlx.core.isposinf"]], "issubdtype() (in module mlx.core)": [[144, "mlx.core.issubdtype"]], "jvp() (in module mlx.core)": [[145, "mlx.core.jvp"]], "less() (in module mlx.core)": [[146, "mlx.core.less"]], "less_equal() (in module mlx.core)": [[147, "mlx.core.less_equal"]], "linspace() (in module mlx.core)": [[150, "mlx.core.linspace"]], "load() (in module mlx.core)": [[151, "mlx.core.load"]], "log() (in module mlx.core)": [[152, "mlx.core.log"]], "log10() (in module mlx.core)": [[153, "mlx.core.log10"]], "log1p() (in module mlx.core)": [[154, "mlx.core.log1p"]], "log2() (in module mlx.core)": [[155, "mlx.core.log2"]], "logaddexp() (in module mlx.core)": [[156, "mlx.core.logaddexp"]], "logical_and() (in module mlx.core)": [[157, "mlx.core.logical_and"]], "logical_not() (in module mlx.core)": [[158, "mlx.core.logical_not"]], "logical_or() (in module mlx.core)": [[159, "mlx.core.logical_or"]], "logsumexp() (in module mlx.core)": [[160, "mlx.core.logsumexp"]], "matmul() (in module mlx.core)": [[161, "mlx.core.matmul"]], "max() (in module mlx.core)": [[162, "mlx.core.max"]], "maximum() (in module mlx.core)": [[163, "mlx.core.maximum"]], "mean() (in module mlx.core)": [[164, "mlx.core.mean"]], "meshgrid() (in module mlx.core)": [[165, "mlx.core.meshgrid"]], "min() (in module mlx.core)": [[175, "mlx.core.min"]], "minimum() (in module mlx.core)": [[176, "mlx.core.minimum"]], "moveaxis() (in module mlx.core)": [[177, "mlx.core.moveaxis"]], "multiply() (in module mlx.core)": [[178, "mlx.core.multiply"]], "negative() (in module mlx.core)": [[179, "mlx.core.negative"]], "new_stream() (in module mlx.core)": [[180, "mlx.core.new_stream"]], "not_equal() (in module mlx.core)": [[181, "mlx.core.not_equal"]], "ones() (in module mlx.core)": [[182, "mlx.core.ones"]], "ones_like() (in module mlx.core)": [[183, "mlx.core.ones_like"]], "outer() (in module mlx.core)": [[184, "mlx.core.outer"]], "pad() (in module mlx.core)": [[185, "mlx.core.pad"]], "partition() (in module mlx.core)": [[186, "mlx.core.partition"]], "prod() (in module mlx.core)": [[187, "mlx.core.prod"]], "quantize() (in module mlx.core)": [[188, "mlx.core.quantize"]], "quantized_matmul() (in module mlx.core)": [[189, "mlx.core.quantized_matmul"]], "radians() (in module mlx.core)": [[190, "mlx.core.radians"]], "reciprocal() (in module mlx.core)": [[202, "mlx.core.reciprocal"]], "repeat() (in module mlx.core)": [[203, "mlx.core.repeat"]], "reshape() (in module mlx.core)": [[204, "mlx.core.reshape"]], "round() (in module mlx.core)": [[205, "mlx.core.round"]], "rsqrt() (in module mlx.core)": [[206, "mlx.core.rsqrt"]], "save() (in module mlx.core)": [[207, "mlx.core.save"]], "save_gguf() (in module mlx.core)": [[208, "mlx.core.save_gguf"]], "save_safetensors() (in module mlx.core)": [[209, "mlx.core.save_safetensors"]], "savez() (in module mlx.core)": [[210, "mlx.core.savez"]], "savez_compressed() (in module mlx.core)": [[211, "mlx.core.savez_compressed"]], "set_default_device() (in module mlx.core)": [[212, "mlx.core.set_default_device"]], "set_default_stream() (in module mlx.core)": [[213, "mlx.core.set_default_stream"]], "sigmoid() (in module mlx.core)": [[214, "mlx.core.sigmoid"]], "sign() (in module mlx.core)": [[215, "mlx.core.sign"]], "sin() (in module mlx.core)": [[216, "mlx.core.sin"]], "sinh() (in module mlx.core)": [[217, "mlx.core.sinh"]], "softmax() (in module mlx.core)": [[218, "mlx.core.softmax"]], "sort() (in module mlx.core)": [[219, "mlx.core.sort"]], "split() (in module mlx.core)": [[220, "mlx.core.split"]], "sqrt() (in module mlx.core)": [[221, "mlx.core.sqrt"]], "square() (in module mlx.core)": [[222, "mlx.core.square"]], "squeeze() (in module mlx.core)": [[223, "mlx.core.squeeze"]], "stack() (in module mlx.core)": [[224, "mlx.core.stack"]], "std() (in module mlx.core)": [[225, "mlx.core.std"]], "stop_gradient() (in module mlx.core)": [[226, "mlx.core.stop_gradient"]], "stream() (in module mlx.core)": [[227, "mlx.core.stream"]], "subtract() (in module mlx.core)": [[228, "mlx.core.subtract"]], "sum() (in module mlx.core)": [[229, "mlx.core.sum"]], "swapaxes() (in module mlx.core)": [[230, "mlx.core.swapaxes"]], "synchronize() (in module mlx.core)": [[231, "mlx.core.synchronize"]], "take() (in module mlx.core)": [[232, "mlx.core.take"]], "take_along_axis() (in module mlx.core)": [[233, "mlx.core.take_along_axis"]], "tan() (in module mlx.core)": [[234, "mlx.core.tan"]], "tanh() (in module mlx.core)": [[235, "mlx.core.tanh"]], "tensordot() (in module mlx.core)": [[236, "mlx.core.tensordot"]], "tile() (in module mlx.core)": [[237, "mlx.core.tile"]], "topk() (in module mlx.core)": [[238, "mlx.core.topk"]], "transpose() (in module mlx.core)": [[239, "mlx.core.transpose"]], "tri() (in module mlx.core)": [[240, "mlx.core.tri"]], "tril() (in module mlx.core)": [[241, "mlx.core.tril"]], "triu() (in module mlx.core)": [[242, "mlx.core.triu"]], "value_and_grad() (in module mlx.core)": [[243, "mlx.core.value_and_grad"]], "var() (in module mlx.core)": [[244, "mlx.core.var"]], "vjp() (in module mlx.core)": [[245, "mlx.core.vjp"]], "vmap() (in module mlx.core)": [[246, "mlx.core.vmap"]], "where() (in module mlx.core)": [[247, "mlx.core.where"]], "zeros() (in module mlx.core)": [[248, "mlx.core.zeros"]], "zeros_like() (in module mlx.core)": [[249, "mlx.core.zeros_like"]], "stream (class in mlx.core)": [[256, "mlx.core.Stream"]], "__init__() (stream method)": [[256, "mlx.core.Stream.__init__"]]}}) \ No newline at end of file diff --git a/docs/build/html/usage/compile.html b/docs/build/html/usage/compile.html index 76c5eea2a..1adfe4bc1 100644 --- a/docs/build/html/usage/compile.html +++ b/docs/build/html/usage/compile.html @@ -8,7 +8,7 @@ - Compilation — MLX 0.10.0 documentation + Compilation — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/usage/function_transforms.html b/docs/build/html/usage/function_transforms.html index 84926247d..5a1ef611f 100644 --- a/docs/build/html/usage/function_transforms.html +++ b/docs/build/html/usage/function_transforms.html @@ -8,7 +8,7 @@ - Function Transforms — MLX 0.10.0 documentation + Function Transforms — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/usage/indexing.html b/docs/build/html/usage/indexing.html index 40e26e919..2d4d508d1 100644 --- a/docs/build/html/usage/indexing.html +++ b/docs/build/html/usage/indexing.html @@ -8,7 +8,7 @@ - Indexing Arrays — MLX 0.10.0 documentation + Indexing Arrays — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/usage/lazy_evaluation.html b/docs/build/html/usage/lazy_evaluation.html index 3e68223fc..2df55f131 100644 --- a/docs/build/html/usage/lazy_evaluation.html +++ b/docs/build/html/usage/lazy_evaluation.html @@ -8,7 +8,7 @@ - Lazy Evaluation — MLX 0.10.0 documentation + Lazy Evaluation — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/usage/numpy.html b/docs/build/html/usage/numpy.html index 7485b0b82..d6403b909 100644 --- a/docs/build/html/usage/numpy.html +++ b/docs/build/html/usage/numpy.html @@ -8,7 +8,7 @@ - Conversion to NumPy and Other Frameworks — MLX 0.10.0 documentation + Conversion to NumPy and Other Frameworks — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/usage/quick_start.html b/docs/build/html/usage/quick_start.html index b06153b3a..97d444b7e 100644 --- a/docs/build/html/usage/quick_start.html +++ b/docs/build/html/usage/quick_start.html @@ -8,7 +8,7 @@ - Quick Start Guide — MLX 0.10.0 documentation + Quick Start Guide — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/usage/saving_and_loading.html b/docs/build/html/usage/saving_and_loading.html index 069a5bbd6..fb83bcbd5 100644 --- a/docs/build/html/usage/saving_and_loading.html +++ b/docs/build/html/usage/saving_and_loading.html @@ -8,7 +8,7 @@ - Saving and Loading Arrays — MLX 0.10.0 documentation + Saving and Loading Arrays — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/usage/unified_memory.html b/docs/build/html/usage/unified_memory.html index 7170fe52c..1439a5f56 100644 --- a/docs/build/html/usage/unified_memory.html +++ b/docs/build/html/usage/unified_memory.html @@ -8,7 +8,7 @@ - Unified Memory — MLX 0.10.0 documentation + Unified Memory — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks diff --git a/docs/build/html/usage/using_streams.html b/docs/build/html/usage/using_streams.html index 6efcbd8e6..d066a9861 100644 --- a/docs/build/html/usage/using_streams.html +++ b/docs/build/html/usage/using_streams.html @@ -8,7 +8,7 @@ - Using Streams — MLX 0.10.0 documentation + Using Streams — MLX 0.12.0 documentation @@ -36,7 +36,7 @@ - + @@ -131,8 +131,8 @@ - MLX 0.10.0 documentation - Home - + MLX 0.12.0 documentation - Home + @@ -240,6 +240,7 @@
  • mlx.core.new_stream
  • mlx.core.set_default_stream
  • mlx.core.stream
  • +
  • mlx.core.synchronize
  • Operations
  • Neural Networks