<jupyter_start><jupyter_text>MXNet<jupyter_code>%pylab inline
import pyhf
from pyhf import Model
from pyhf.simplemodels import hepdata_like
import mxnet as mx
source = {
  "binning": [2,-0.5,1.5],
  "bindata": {
    "data": [120.0, 180.0],
    "bkg": [100.0, 150.0],
    "bkgerr": [10.0, 10.0],
    "sig": [30.0, 95.0]
  }
}

pdf = hepdata_like(source['bindata']['sig'], source['bindata']['bkg'], source['bindata']['bkgerr'])
data = source['bindata']['data'] + pdf.config.auxdata

init_pars = pdf.config.suggested_init()
par_bounds = pdf.config.suggested_bounds()


print('--------\nas MXNet\n--------')
pyhf.tensorlib = pyhf.mxnet_backend()
v = pdf.logpdf(init_pars, data)
print(type(v),v)<jupyter_output>--------
as MXNet
--------
<class 'mxnet.ndarray.ndarray.NDArray'> 
[-22.87784958]
<NDArray 1 @cpu(0)>
{'fraction_non_alphanumeric': 0.22772277227722773, 'fraction_numerical': 0.055693069306930694, 'mean_word_length': 4.088050314465409, 'pattern_counts': {'":': 6, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '550201', 'license': 'Apache-2.0', 'n_tokens_mistral': 357, 'n_tokens_neox': 331, 'n_words': 59, 'path': 'docs/examples/notebooks/example-mxnet.ipynb', 'repo_name': 'minrk/pyhf', 'size': '808'}