MCPcopy Create free account
hub / github.com/pytorch/tutorials / num_flat_features

Method num_flat_features

beginner_source/introyt/introyt1_tutorial.py:199–204  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

197 return x
198
199 def num_flat_features(self, x):
200 size = x.size()[1:] # all dimensions except the batch dimension
201 num_features = 1
202 for s in size:
203 num_features *= s
204 return num_features
205
206
207############################################################################

Callers 1

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected