<jupyter_start><jupyter_text>Install deepC dnn Compiler<jupyter_code>!pip install --upgrade --force-reinstall deepC==0.11<jupyter_output><empty_output><jupyter_text>Import deepC.dnnc<jupyter_code>import deepC.dnnc as dc<jupyter_output><empty_output><jupyter_text>Create Tensors<jupyter_code>t0 = dc.zeros(3,2)
t1 = dc.ones(2,3)
t2 = dc.array([[1,2,3],[4,5,6]])
t3 = dc.array([[10,20,30],[40,50,60]]).asTypeInt()
print(t2)<jupyter_output>[[1.000000 2.000000 3.000000]
 [4.000000 5.000000 6.000000]]<jupyter_text>Perform Pythonic OperationsAll python operators are available on tensors.<jupyter_code>y=t1 + t2
print(y)

print("."*30)

z= t3/y.asTypeInt()
print(z)<jupyter_output>[[2.000000 3.000000 4.000000]
 [5.000000 6.000000 7.000000]]
..............................
[[5.000000 6.666667 7.500000]
 [8.000000 8.333333 8.571428]]<jupyter_text>Broadcasting and Implicit Conversion<jupyter_code>a=True
b=dc.array([[1,2,3],[4,5,6]])
y=a+b; # adding bool and floatTensor of different ranks
y<jupyter_output><empty_output><jupyter_text>Tensor to other types1. Numpy array1. Python List1. Python Tuple<jupyter_code>import numpy as np
py_list = list(y);   # convert tensor to python list
py_tuple = tuple(y); # convert tensor to python tuple
np_ary = y.numpy()   # convert tensor to numpy array<jupyter_output><empty_output><jupyter_text>Looping throught Tensors<jupyter_code>for num in dc.arange(5):
  print(num)<jupyter_output>0.0
1.0
2.0
3.0
4.0<jupyter_text>Neural Network Operators100s of NN operators are available<jupyter_code>#x=dc.arange(4,-4)
#x=dc.array([-4,-3,-2,-1,0,1,2,3,4])
#y=dc.sigmoid(x)

x=dc.arange(1256)/100
sinx=dc.sin(x)
cosx=dc.cos(x)<jupyter_output><empty_output><jupyter_text>Plot DataDNNC tensors support all popular libraries inlcuding matplot, seaborn etc.  Line Plot<jupyter_code>import matplotlib.pyplot as plt
plt.plot (x.data(),sinx.data())
plt.plot(x.data(), cosx.data())<jupyter_output><empty_output><jupyter_text>Histogram<jupyter_code>plt.hist(list(dc.array(10000)), bins=50)
plt.show()<jupyter_output><empty_output><jupyter_text>Scatter Plot<jupyter_code>plt.scatter(dc.array(256).data(), 
            list(dc.sin(dc.array(256))),
            c=np.random.rand(256),
            alpha=0.5)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1688888888888889, 'fraction_numerical': 0.09777777777777778, 'mean_word_length': 6.1687898089171975, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 42, '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': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '324364', 'license': 'Apache-2.0', 'n_tokens_mistral': 1071, 'n_tokens_neox': 929, 'n_words': 144, 'path': 'tutorials/Getting_Started_With_deepC.ipynb', 'repo_name': 'on-device-ai/deepC', 'size': '2250'}