MCPcopy Create free account
hub / github.com/pytorch/pytorch / NextBlob

Method NextBlob

caffe2/python/core.py:1951–1965  ·  view source on GitHub ↗

Return the blob that has not been defined or registered in the current net. It returns `BlobReference(prefix)`, if it's valid, otherwise `BlobReference(prefix) + '_auto_' + ?`. Different calls is guaranteed to return blob with different names.

(self, prefix='unnamed')

Source from the content-addressed store, hash-verified

1949 return self.NextBlob(output_blob_base)
1950
1951 def NextBlob(self, prefix='unnamed'):
1952 """Return the blob that has not been defined or registered in the
1953 current net. It returns `BlobReference(prefix)`, if it's valid,
1954 otherwise `BlobReference(prefix) + '_auto_' + ?`. Different calls
1955 is guaranteed to return blob with different names."""
1956 output_blob_base = BlobReference(prefix)
1957 output_blob = output_blob_base
1958 index = 0
1959 while str(output_blob) in self._registered_blob_names or (
1960 self.BlobIsDefined(output_blob)):
1961 output_blob = output_blob_base + '_auto_' + str(index)
1962 index += 1
1963
1964 self._registered_blob_names.add(str(output_blob))
1965 return output_blob
1966
1967 def NextName(self, prefix=None, output_id=None):
1968 """Returns the next name to be used, if you do not want to explicitly

Callers 6

NextScopedBlobMethod · 0.95
create_netMethod · 0.95
test_next_blobMethod · 0.95
add_global_constantMethod · 0.80
__init__Method · 0.80
__init__Method · 0.80

Calls 3

BlobIsDefinedMethod · 0.95
BlobReferenceClass · 0.85
addMethod · 0.45

Tested by 2

create_netMethod · 0.76
test_next_blobMethod · 0.76