syntax for ellipsis like as "net.blobs['data'].data[...] = transformed_image"

xuanwu348 xuanwu348 at 163.com
Sat Oct 26 10:51:31 EDT 2019


Hi buddies


Have a good weekend!
I have read some code in caffe, but I confused at "net.blobs['data'].data[...] = transformed_image".
The code can be find in this link:https://github.com/BVLC/caffe/blob/master/examples/00-classification.ipynb
import caffe
model_def = os.path.join(caffe_root, "models/bvlc_alexnet/deploy.prototxt")
model_weights = os.path.join(caffe_root, "models/bvlc_alexnet/bvlc_alexnet.caffemodel")
net = caffe.Net(model_def,
                model_weights,
                caffe.TEST)
net.blobs['data'].reshape(50,
                          3,
                          227,227)
net.blobs['data'].data[...] = transformed_image


1. For ellipsis, is there syntax in python like this " net.blobs['data'].data[...]"? I have checked it which the type is "<class 'numpy.ndarray'>"
2. Could you provide some samples in which need to use ellipsis. 


But in python, ellipsis define as below, I did not find the relationship to "net.blobs['data'].data[...]":
Help on ellipsis object:


class ellipsis(object)
 |  Methods defined here:
 |
 |  __getattribute__(self, name, /)
 |      Return getattr(self, name).
 |
 |  __new__(*args, **kwargs) from builtins.type
 |      Create and return a new object.  See help(type) for accurate signature.
 |
 |  __reduce__(...)
 |      helper for pickle
 |
 |  __repr__(self, /)
 |      Return repr(self).


Thanks for your help!


Best Regards





More information about the Python-list mailing list