Returns the next name to be used, if you do not want to explicitly name your blob. [Deprecated, use NextBlob, NextScopedBlob instead]
(self, prefix=None, output_id=None)
| 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 |
| 1969 | name your blob. [Deprecated, use NextBlob, NextScopedBlob instead]""" |
| 1970 | if prefix: |
| 1971 | output_name_base = self._net.name + '/' + prefix |
| 1972 | output_name = output_name_base |
| 1973 | if output_id is not None: |
| 1974 | output_name += ':' + str(output_id) |
| 1975 | key = output_name |
| 1976 | index = self._next_blob_name_ids.get(key, 2) |
| 1977 | while self.BlobIsDefined(str(ScopedBlobReference(output_name))): |
| 1978 | output_name = output_name_base + '_' + str(index) |
| 1979 | if output_id is not None: |
| 1980 | output_name += ':' + str(output_id) |
| 1981 | index += 1 |
| 1982 | self._next_blob_name_ids[key] = index |
| 1983 | else: |
| 1984 | output_name = self._net.name + '_blob_' + str(self._next_name_index) |
| 1985 | self._next_name_index += 1 |
| 1986 | return str(output_name) |
| 1987 | |
| 1988 | def _ExtendOps(self, new_ops): |
| 1989 | self._net.op.extend(new_ops) |