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

Method add_train_ops

caffe2/python/layers/fc_with_bootstrap.py:323–345  ·  view source on GitHub ↗
(self, net)

Source from the content-addressed store, hash-verified

321 )
322
323 def add_train_ops(self, net):
324 # use the train_param_blobs to be consistent with the SamplingTrain unittest
325
326 # obtain features
327 for i in range(self.num_bootstrap):
328 indices = self._generate_bootstrapped_indices(
329 net=net,
330 copied_cur_layer=self.input_record.field_blobs()[0],
331 iteration=i,
332 )
333 bootstrapped_features = self._bootstrap_ops(
334 net=net,
335 copied_cur_layer=self.input_record.field_blobs()[0],
336 indices=indices,
337 iteration=i,
338 )
339 self._add_ops(
340 net,
341 features=bootstrapped_features,
342 iteration=i,
343 params=self.train_param_blobs[i * 2 : (i * 2) + 2],
344 version="fp32",
345 )
346
347 def get_fp16_compatible_parameters(self):
348 if self.output_dim_vec is None or len(self.output_dim_vec) == 1:

Callers

nothing calls this directly

Calls 5

_bootstrap_opsMethod · 0.95
_add_opsMethod · 0.95
rangeFunction · 0.50
field_blobsMethod · 0.45

Tested by

no test coverage detected