1 package org.intel.openvino;
3 public class Blob extends IEWrapper {
5 protected Blob(long addr) {
9 public Blob(TensorDesc tensorDesc) {
10 super(GetBlob(tensorDesc.getNativeObjAddr()));
13 public Blob(TensorDesc tensorDesc, byte[] data) {
14 super(BlobByte(tensorDesc.getNativeObjAddr(), data)) ;
17 public Blob(TensorDesc tensorDesc, float[] data) {
18 super(BlobFloat(tensorDesc.getNativeObjAddr(), data));
21 public Blob(TensorDesc tensorDesc, long cArray) {
22 super(BlobCArray(tensorDesc.nativeObj, cArray));
25 public TensorDesc getTensorDesc(){
26 return new TensorDesc(GetTensorDesc(nativeObj));
30 return size(nativeObj);
33 public LockedMemory rmap() {
34 return new LockedMemory(rmap(nativeObj));
37 /*----------------------------------- native methods -----------------------------------*/
38 private native long GetTensorDesc(long addr);
40 private static native long GetBlob(long tensorDesc);
42 private static native long BlobByte(long tensorDesc, byte[] data);
44 private static native long BlobFloat(long tensorDesc, float[] data);
46 private static native long BlobCArray(long tensorDesc, long cArray);
48 private static native byte[] asByte(long addr);
50 private static native float[] asFloat(long addr);
52 private static native int size(long addr);
54 private static native long rmap(long addr);
57 protected native void delete(long nativeObj);