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

Method _add_ops

caffe2/python/layers/fc_with_bootstrap.py:263–288  ·  view source on GitHub ↗

Args: params: the weight and bias, passed by either add_ops or add_train_ops function features: feature blobs to predict on. Can be the actual cur_layer or the bootstrapped_feature blobs. version: currently fp32 support only

(self, net, features, iteration, params, version)

Source from the content-addressed store, hash-verified

261 raise Exception("unsupported FC type version {}".format(version))
262
263 def _add_ops(self, net, features, iteration, params, version):
264 """
265 Args:
266 params: the weight and bias, passed by either add_ops or
267 add_train_ops function
268
269 features: feature blobs to predict on. Can be the actual cur_layer
270 or the bootstrapped_feature blobs.
271
272 version: currently fp32 support only
273 """
274
275 if self.clip_args is not None:
276 clipped_params = [net.NextScopedBlob("clipped_%s" % str(p)) for p in params]
277 for p, cp in zip(params, clipped_params):
278 net.Clip([p], [cp], **self.clip_args)
279 params = clipped_params
280
281 if self.output_dim_vec is None or len(self.output_dim_vec) == 1:
282 self._insert_fc_ops(
283 net=net,
284 features=features,
285 params=params,
286 outputs=[self.output_schema.field_blobs()[(iteration * 2) + 1]],
287 version=version,
288 )
289
290 def add_ops(self, net):
291 """

Callers 2

add_opsMethod · 0.95
add_train_opsMethod · 0.95

Calls 3

_insert_fc_opsMethod · 0.95
NextScopedBlobMethod · 0.80
field_blobsMethod · 0.45

Tested by

no test coverage detected