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

Method num_flat_features

beginner_source/introyt/modelsyt_tutorial.py:174–179  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

172 return x
173
174 def num_flat_features(self, x):
175 size = x.size()[1:] # all dimensions except the batch dimension
176 num_features = 1
177 for s in size:
178 num_features *= s
179 return num_features
180
181
182##########################################################################

Callers 1

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected