/usr/local/lib64/python3.6/site-packages/caffe2/python/__pycache__
NameSizeModeActions
allcompare_test.cpython-36.pyc27100644editdlrm
attention.cpython-36.pyc49380644editdlrm
benchmark_generator.cpython-36.pyc39100644editdlrm
binarysize.cpython-36.pyc48530644editdlrm
brew.cpython-36.pyc38490644editdlrm
brew_test.cpython-36.pyc104520644editdlrm
build.cpython-36.pyc3400644editdlrm
cached_reader.cpython-36.pyc29540644editdlrm
caffe_translator.cpython-36.pyc241650644editdlrm
caffe_translator_test.cpython-36.pyc29290644editdlrm
checkpoint.cpython-36.pyc279730644editdlrm
checkpoint_test.cpython-36.pyc94620644editdlrm
cnn.cpython-36.pyc84350644editdlrm
context.cpython-36.pyc40080644editdlrm
context_test.cpython-36.pyc26650644editdlrm
control.cpython-36.pyc144660644editdlrm
control_ops_grad.cpython-36.pyc163650644editdlrm
control_ops_grad_test.cpython-36.pyc15020644editdlrm
control_ops_util.cpython-36.pyc83320644editdlrm
control_test.cpython-36.pyc118700644editdlrm
convert.cpython-36.pyc1480644editdlrm
convert_test.cpython-36.pyc5680644editdlrm
convnet_benchmarks.cpython-36.pyc129450644editdlrm
convnet_benchmarks_test.cpython-36.pyc10900644editdlrm
core.cpython-36.pyc944280644editdlrm
core_gradients_test.cpython-36.pyc248250644editdlrm
core_test.cpython-36.pyc339420644editdlrm
crf.cpython-36.pyc76220644editdlrm
crf_predict.cpython-36.pyc10440644editdlrm
crf_viterbi_test.cpython-36.pyc16770644editdlrm
dataio.cpython-36.pyc239780644editdlrm
dataio_test.cpython-36.pyc132670644editdlrm
dataset.cpython-36.pyc128790644editdlrm
data_parallel_model.cpython-36.pyc514160644editdlrm
data_parallel_model_test.cpython-36.pyc389230644editdlrm
data_workers.cpython-36.pyc131420644editdlrm
data_workers_test.cpython-36.pyc45220644editdlrm
db_file_reader.cpython-36.pyc53610644editdlrm
db_test.cpython-36.pyc13280644editdlrm
device_checker.cpython-36.pyc40140644editdlrm
dyndep.cpython-36.pyc15680644editdlrm
embedding_generation_benchmark.cpython-36.pyc42030644editdlrm
experiment_util.cpython-36.pyc32330644editdlrm
extension_loader.cpython-36.pyc5430644editdlrm
fakefp16_transform_lib.cpython-36.pyc5460644editdlrm
filler_test.cpython-36.pyc9250644editdlrm
functional.cpython-36.pyc35310644editdlrm
functional_test.cpython-36.pyc41320644editdlrm
fused_8bit_rowwise_conversion_ops_test.cpython-36.pyc36310644editdlrm
gradient_checker.cpython-36.pyc106220644editdlrm
gradient_check_test.cpython-36.pyc167880644editdlrm
gru_cell.cpython-36.pyc25960644editdlrm
hip_test_util.cpython-36.pyc6690644editdlrm
hsm_util.cpython-36.pyc18230644editdlrm
hypothesis_test.cpython-36.pyc843120644editdlrm
hypothesis_test_util.cpython-36.pyc200390644editdlrm
ideep_test_util.cpython-36.pyc10810644editdlrm
layers_test.cpython-36.pyc573720644editdlrm
layer_model_helper.cpython-36.pyc216410644editdlrm
layer_model_instantiator.cpython-36.pyc36650644editdlrm
layer_parameter_sharing_test.cpython-36.pyc56260644editdlrm
layer_test_util.cpython-36.pyc52730644editdlrm
lazy.cpython-36.pyc4240644editdlrm
lazy_dyndep.cpython-36.pyc24750644editdlrm
lazy_dyndep_test.cpython-36.pyc48070644editdlrm
lengths_reducer_fused_8bit_rowwise_ops_test.cpython-36.pyc43920644editdlrm
lengths_reducer_rowwise_8bit_ops_test.cpython-36.pyc36840644editdlrm
lstm_benchmark.cpython-36.pyc72820644editdlrm
memonger.cpython-36.pyc321700644editdlrm
memonger_test.cpython-36.pyc231000644editdlrm
mkl_test_util.cpython-36.pyc11910644editdlrm
model_device_test.cpython-36.pyc33760644editdlrm
model_helper.cpython-36.pyc186180644editdlrm
model_helper_test.cpython-36.pyc19910644editdlrm
modifier_context.cpython-36.pyc26500644editdlrm
muji.cpython-36.pyc55660644editdlrm
muji_test.cpython-36.pyc35670644editdlrm
net_builder.cpython-36.pyc267860644editdlrm
net_builder_test.cpython-36.pyc92550644editdlrm
net_drawer.cpython-36.pyc100560644editdlrm
net_printer.cpython-36.pyc143670644editdlrm
net_printer_test.cpython-36.pyc33230644editdlrm
nomnigraph.cpython-36.pyc51250644editdlrm
nomnigraph_test.cpython-36.pyc145910644editdlrm
nomnigraph_transformations.cpython-36.pyc24310644editdlrm
nomnigraph_transformations_test.cpython-36.pyc40730644editdlrm
normalizer.cpython-36.pyc19410644editdlrm
normalizer_context.cpython-36.pyc15530644editdlrm
normalizer_test.cpython-36.pyc8700644editdlrm
numa_benchmark.cpython-36.pyc18860644editdlrm
numa_test.cpython-36.pyc16260644editdlrm
observer_test.cpython-36.pyc41810644editdlrm
operator_fp_exceptions_test.cpython-36.pyc13050644editdlrm
optimizer.cpython-36.pyc456060644editdlrm
optimizer_context.cpython-36.pyc20080644editdlrm
optimizer_test.cpython-36.pyc247470644editdlrm
optimizer_test_util.cpython-36.pyc68080644editdlrm
parallelize_bmuf_distributed_test.cpython-36.pyc69900644editdlrm
parallel_workers.cpython-36.pyc91480644editdlrm
parallel_workers_test.cpython-36.pyc38240644editdlrm
pipeline.cpython-36.pyc129400644editdlrm
pipeline_test.cpython-36.pyc27150644editdlrm
predictor_constants.cpython-36.pyc3040644editdlrm
python_op_test.cpython-36.pyc105020644editdlrm
queue_util.cpython-36.pyc50550644editdlrm
record_queue.cpython-36.pyc42250644editdlrm
recurrent.cpython-36.pyc98930644editdlrm
regularizer.cpython-36.pyc186040644editdlrm
regularizer_context.cpython-36.pyc15620644editdlrm
regularizer_test.cpython-36.pyc88250644editdlrm
rnn_cell.cpython-36.pyc447850644editdlrm
schema.cpython-36.pyc417630644editdlrm
schema_test.cpython-36.pyc137870644editdlrm
scope.cpython-36.pyc26000644editdlrm
scope_test.cpython-36.pyc40680644editdlrm
session.cpython-36.pyc73460644editdlrm
session_test.cpython-36.pyc23530644editdlrm
sparse_to_dense_mask_test.cpython-36.pyc52980644editdlrm
sparse_to_dense_test.cpython-36.pyc30030644editdlrm
task.cpython-36.pyc222070644editdlrm
task_test.cpython-36.pyc11780644editdlrm
test_util.cpython-36.pyc37290644editdlrm
text_file_reader.cpython-36.pyc22390644editdlrm
timeout_guard.cpython-36.pyc31060644editdlrm
toy_regression_test.cpython-36.pyc23600644editdlrm
transformations.cpython-36.pyc18330644editdlrm
transformations_test.cpython-36.pyc96080644editdlrm
tt_core.cpython-36.pyc64680644editdlrm
tt_core_test.cpython-36.pyc18240644editdlrm
utils.cpython-36.pyc122450644editdlrm
utils_test.cpython-36.pyc14160644editdlrm
visualize.cpython-36.pyc60270644editdlrm
workspace.cpython-36.pyc226900644editdlrm
workspace_test.cpython-36.pyc290550644editdlrm
_import_c_extension.cpython-36.pyc15240644editdlrm
__init__.cpython-36.pyc26070644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/caffe2/python/__pycache__/dataset.cpython-36.pyc (12879B)
3 EgV2@sdZddlmZmZddlmZmZddlmZm Z m Z m Z ddl Z GdddeZGdd d eZGd d d eZdd d ZddZGdddeZdS)aH Implementation of an in-memory dataset with structured schema. Use this to store and iterate through datasets with complex schema that fit in memory. Iterating through entries of this dataset is very fast since the dataset is stored as a set of native Caffe2 tensors, thus no type conversion or deserialization is necessary. )core workspace)ReaderWriter)Structfrom_blob_listfrom_column_listInitEmptyRecordNc@s.eZdZd ddZddZddZd d Zd S) _DatasetReaderFcCs<tj||j||_|p"|jd|_||_||_d|_dS)z7Don't call this directly. Instead, use dataset.reader()_cursorN)r__init__contentdatasetname batch_sizeenforce_batch_sizecursor)selfrrrrrA/usr/local/lib64/python3.6/site-packages/caffe2/python/dataset.pyr s z_DatasetReader.__init__cCs,|jdkr(|jg|j|j|jjd|_dS)N)fields)rCreateTreeCursorNextScopedBlobrrr)rinit_netexit_netrrrsetup_ex#s   z_DatasetReader.setup_exc Csz|jstd|jj}tj|j|jF|j|jg|j |j |j |j d}tj |}|j|dg|fSQRXdS)Nzsetup not called.)rrr)rAssertionErrorrrr NameScopeNextNamerZ ReadNextBatch field_blobs field_namesrroutput_to_listIsEmpty)rread_netrrrrrread*s   z_DatasetReader.readcCs|j|jggdS)N) ResetCursorr)rnetrrrreset6sz_DatasetReader.resetN)r F)__name__ __module__ __qualname__r rr%r(rrrrr s  r c@s@eZdZdddZddZddZd d Zdd d ZddZd S)_DatasetRandomReaderr FcCsHtj||j||_d|_|p(|jd|_||_||_||_||_ dS)z>Don't call this directly. Instead, use dataset.random_reader()Nr ) rr rrrrindicesr loop_overr)rrrr-rr.rrrrr ;sz_DatasetRandomReader.__init__cCs,|jdkr(|jg|j|j|jjd|_dS)N)r)rrrrrr)rrrrrrrGs   z_DatasetRandomReader.setup_excCs|j|jggdS)N)r&r)rr'rrrr(Nsz_DatasetRandomReader.resetcCs2|j||j|jg|jjjd}||_dS)Noffsets)r(Z ComputeOffsetrrrr r/)rr'r/rrr computeoffsetQs  z"_DatasetRandomReader.computeoffsetNcCsh|jj}d}|r4||jks&td|jj|}|j||j|jg|jd|||d}||_ dS)Nr zMust be valid field.r-)sort_by_field_idx shuffle_sizer) rrr!rindexr(ZSortAndShufflerr r-)rr'Z sort_by_fieldr2rrr1r-rrrsort_and_shuffleXs  z%_DatasetRandomReader.sort_and_shufflecCs|jstd|jstd|js*td|jj}tj|j|j R|j |j|j|jg|j |j |j |j|jd}tj|}|j|dg|fSQRXdS)Nzsetup_ex not calledzsort_and_shuffle not calledzcomputeoffset not called)rrr.r)rrr-r/rrrrrrZReadRandomBatchr r!rrr.r"r#)rr$rrrrrr%ks   z_DatasetRandomReader.read)r FF)Nr r ) r)r*r+r rr(r0r5r%rrrrr,:s  r,c@s,eZdZddZddZddZddZd S) _DatasetWritercCs||_d|_dS)z7Don't call this directly. Use dataset.writer() instead.N)_contentmutex)rrrrrr }sz_DatasetWriter.__init__cCs|jdkr|jg|_dS)N)r8Z CreateMutex)rrrrrrrs z_DatasetWriter.setup_excCsz|jdk std|jj}t|t|ksDtdt|t|f|j|g|jjd|j|jg|t||dS)a Add operations to `net` that append the blobs in `fields` to the end of the dataset. An additional operator will also be added that checks the consistency of the data in `fields` against the dataset schema. Args: writer_net: The net that will contain the Append operators. fields: A list of BlobReference to be appeneded to this dataset. Nzsetup not called.zExpected %s fields, got %s.)r) r8rr7r lenZCheckDatasetConsistencyr!Z AtomicAppendlist)rZ writer_netrr rrrwrites  z_DatasetWriter.writecCsdS)z+Commit is a no-op for an in-memory dataset.Nr)rZ finish_netrrrcommitsz_DatasetWriter.commitN)r)r*r+r rr;r<rrrrr6|sr6cCsHt|tjstdtj||d}|j|j|d}tj t |||S)a Create a 'constant' by first creating an external input in the given net, and then feeding the corresponding blob with its provided value in the current workspace. The name is automatically generated in order to avoid clashes with existing blob names. z net must be a core.Net instance.)dtype)prefix) isinstancerNetrnparrayZAddExternalInputrrZFeedBlobstr)r'valuer=rZblobrrrConsts rEcCs,tjd}|j|ggtj|||dddS)N report_netT)rFZconcurrent_substepsZreport_interval)rr@ZPrintZexecution_step)rrZsubstepsZ rows_readrFrrrexecution_step_with_progresss rHc@speZdZdZdddZddZddZd d Zd d Zd dZ ddZ ddZ dddZ dddZ dddZdS)DatasetaSRepresents an in-memory dataset with fixed schema. Use this to store and iterate through datasets with complex schema that fit in memory. Iterating through entries of this dataset is very fast since the dataset is stored as a set of native Caffe2 tensors, thus no type conversion or deserialization is necessary. NcCslt|tst|tstdt|tr.t|}||_|j|_|j|_|pNd|_ |j rb|j nd|_ dS)aCreate an un-initialized dataset with schema provided by `fields`. Before this dataset can be used, it must be initialized, either by `init_empty` or `init_from_dataframe`. Args: fields: either a schema.Struct or a list of field names in a format compatible with the one described in schema.py. name: optional name to prepend to blobs that will store the data. zsz/Dataset.init_from_dataframe..N)r9rcolumnsr enumerater )rr'rSr)rSr'rinit_from_dataframes zDataset.init_from_dataframecCs|st|jS)zx Return the list of BlobReference pointing to the blobs that contain the data for this dataset. )rr )rrrr get_blobsszDataset.get_blobscCst|j|jS)zi Return a Record of BlobReferences pointing to the full content of this dataset. )rrJr )rrrrrszDataset.contentcCs|jS)z0Return the list of field names for this dataset.)r)rrrrr!szDataset.field_namescCs|jS)z Return the list of field dtypes for this dataset. If a list of strings, not a schema.Struct, was passed to the constructor, this will return a list of dtype(np.void). )rK)rrrrrK szDataset.field_typesr FcCs4|jstdt||||}|dk r0|j|d|S)aCreate a Reader object that is used to iterate through the dataset. This will append operations to `init_net` that create a TreeCursor, used to iterate through the data. NOTE: Currently, it is not safe to append to a dataset while reading. Args: init_net: net that will be run once to create the cursor. cursor_name: optional name for the blob containing a pointer to the cursor. batch_size: how many samples to read per iteration. Returns: A _DatasetReader that can be used to create operators that will iterate through the dataset. zDataset not initialized.N)r rr r)rr cursor_namerrreaderrrrrZs  zDataset.readercCs8|jstdt||||||}|dk r4|j|d|S)aCreate a Reader object that is used to iterate through the dataset. NOTE: The reader order depends on the order in indices. Args: init_net: net that will be run once to create the cursor. indices: blob of reading order cursor_name: optional name for the blob containing a pointer to the cursor. batch_size: how many samples to read per iteration. loop_over: repeat the dataset indefinitely (in the same order) Returns: A DatasetReader that can be used to create operators that will iterate through the dataset according to indices. zDataset not initialized.N)r rr,r)rrr-rYrr.rrZrrr random_reader.s  zDataset.random_readercCs2|jstdt|j}|dk r.|j|d|S)aCreate a Writer that can be used to append entries into the dataset. NOTE: Currently, it is not safe to append to a dataset while reading from it. NOTE: Currently implementation of writer is not thread safe. TODO: fixme Args: init_net: net that will be run once in order to create the writer. (currently not used) zDataset not initialized.N)r rr6rr)rrwriterrrrr\Hs   zDataset.writer)N)NNr F)NNNr FF)N)r)r*r+__doc__r rMrNrWrXrr!rKrZr[r\rrrrrIs        rI)NN)r]Z caffe2.pythonrrZcaffe2.python.dataiorrZcaffe2.python.schemarrrr ZnumpyrAr r,r6rErHobjectrIrrrr s!B#