RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

RunMat™ is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

LicensePrivacy
/
See all docs
Builtin Reference
    • adamupdate
    • analyzeNetwork
    • bilstmLayer
    • classificationLayer
    • combvec
    • convolution1dLayer
    • crossentropy
    • dlarray
    • dlfeval
    • dlgradient
    • dlnetwork
    • dlupdate
    • eluLayer
    • exportONNXNetwork
    • featureInputLayer
    • forward
    • fullyConnectedLayer
    • globalAveragePooling1dLayer
    • layerGraph
    • layerNormalizationLayer
    • lstmLayer
    • padsequences
    • regressionLayer
    • reluLayer
    • sequenceInputLayer
    • softmaxLayer
    • trainingOptions
    • trainnet
    • trainNetwork

dlfeval — Evaluate a function handle in Deep Learning compatibility context.

dlfeval(fun,args...) invokes a function handle through RunMat's function-handle dispatch and forwards requested outputs.

Syntax

varargout = dlfeval(fun, args...)

How dlfeval works

  • fun must be a function handle value, including named handles, method handles, bound handles, and closures.
  • Requested output count is preserved, so bracketed multi-output calls forward to the invoked function.
  • A bounded automatic-differentiation tape is installed for the call. Host dlarray inputs, supported dlnetwork learnables, dlarray arithmetic, scalar sums, and supported forward layer chains can be differentiated with dlgradient inside fun.
  • Text function names and callable objects are rejected by dlfeval; use feval for those RunMat extension forms.

GPU memory and residency

dlfeval preserves callable dispatch behavior. GPU-backed dlarray values are rejected for automatic differentiation with an explicit provider-gap error because provider-resident tape kernels are not implemented yet.

Example

Evaluate Function

[loss,gradients] = dlfeval(@modelLoss, net, X, T)

Expected output:

Outputs returned by `modelLoss`, including traced losses and gradients from `dlgradient`.

Using dlfeval with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how dlfeval changes the result.

Run a small dlfeval example, explain the result, then change one input and compare the output.

Related Deep Learning functions

adamupdate · analyzeNetwork · bilstmLayer · classificationLayer · combvec · convolution1dLayer · crossentropy · dlarray · dlgradient · dlnetwork · dlupdate · eluLayer · exportONNXNetwork · featureInputLayer · forward · fullyConnectedLayer · globalAveragePooling1dLayer · layerGraph · layerNormalizationLayer · lstmLayer · padsequences · regressionLayer · reluLayer · sequenceInputLayer · softmaxLayer · trainingOptions · trainnet · trainNetwork

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • How dlfeval works
  • GPU memory and residency
  • Example
  • Evaluate Function
  • Using dlfeval with coding agents
  • Related Deep Learning functions
  • About RunMat