code
stringlengths
3
6.57k
optimizer_D.step()
np.mean(np.argmax(label_pred.data.cpu()
numpy()
labels_A.data.cpu()
numpy()
task_performance.append(acc)
len(task_performance)
task_performance.pop(0)
classifier(imgs_B)
np.mean(np.argmax(pred_B.data.cpu()
numpy()
labels_B.numpy()
target_performance.append(target_acc)
len(target_performance)
target_performance.pop(0)
print ("[Epoch %d/%d] [Batch %d/%d] [D loss: %f] [G loss: %f] [CLF acc: %3d%% (%3d%%)
len(dataloader_A)
d_loss.item()
g_loss.item()
np.mean(task_performance)
np.mean(target_performance)
len(dataloader_A)
torch.cat((imgs_A.data[:5], fake_B.data[:5], imgs_B.data[:5])
save_image(sample, 'images/%d.png' % batches_done, nrow=int(math.sqrt(batch_size)
get_requests_session()
requests.sessions.Session()
session.mount('http://', HTTPAdapter(pool_connections=25, pool_maxsize=25, pool_block=True)
session.mount('https://', HTTPAdapter(pool_connections=25, pool_maxsize=25, pool_block=True)
Copyright (c)
GeometryOutputNode(sgtk.platform.Application)
init_app(self)
self.import_module("tk_houdini_geometrynode")
module.ToolkitGeometryNodeHandler(self)
convert_to_geometry_nodes(self)
self.handler.convert_sg_to_geometry_nodes()
convert_from_geometry_nodes(self)
self.handler.convert_geometry_to_sg_nodes()
get_nodes(self)
sgtk.platform.current_engine()
app.get_nodes()
self.log_debug("Retrieving tk-houdini-geometrynode nodes...")
self.import_module("tk_houdini_geometrynode")
get_all_tk_geometry_nodes()
self.log_debug("Found %s tk-houdini-geometrynode nodes." % (len(nodes)
Copyright (c)
test_test_time_augmentation_on_cpu()
mmcv.Config.fromfile(config_file)
dict(type='BN', requires_grad=True)
init_segmentor(config, checkpoint_file, device='cpu')
osp.join(osp.dirname(__file__)
inference_segmentor(model, img)
Foundation (ASF)
typehints.with_output_types(types.Entity)
ReadFromDatastore(PTransform)
__init__(self, query, num_splits=0)
super(ReadFromDatastore, self)
__init__()
ValueError("query.project cannot be empty")
ValueError("query cannot be empty")
ValueError("num_splits must be greater than or equal 0")
expand(self, pcoll)
Create([self._query])
Reshuffle()
ParDo(ReadFromDatastore._QueryFn()
display_data(self)
str(self._query)
typehints.with_input_types(types.Query)
typehints.with_output_types(types.Query)
_SplitQueryFn(DoFn)
__init__(self, num_splits)
super(ReadFromDatastore._SplitQueryFn, self)
__init__()
process(self, query, *args, **kwargs)
helper.get_client(query.project, query.namespace)
query_splitter.validate_split(query)
self.get_estimated_num_splits(client, query)
logging.info("Splitting the query into %d splits", estimated_num_splits)
display_data(self)
query_latest_statistics_timestamp(client)
timestamp (in microseconds)
client.query(kind=kind, order=["-timestamp", ])
list(query.fetch(limit=1)
RuntimeError("Datastore total statistics unavailable.")
get_estimated_size_bytes(client, query)
query_latest_statistics_timestamp(client)
client.query(kind=kind)
query.add_filter('kind_name', '=', kind_name)
query.add_filter('timestamp', '=', latest_timestamp)
list(query.fetch(limit=1)
get_estimated_num_splits(client, query)
get_estimated_size_bytes(client, query)
logging.info('Estimated size bytes for query: %s', estimated_size_bytes)
float(estimated_size_bytes)
logging.warning('Failed to fetch estimated size bytes: %s', e)
max(num_splits, ReadFromDatastore._NUM_QUERY_SPLITS_MIN)
typehints.with_input_types(types.Query)
typehints.with_output_types(types.Entity)
_QueryFn(DoFn)
process(self, query, *unused_args, **unused_kwargs)
helper.get_client(query.project, query.namespace)