MCPcopy Index your code
hub / github.com/pytorch/pytorch / _struct_from_nested_name

Method _struct_from_nested_name

caffe2/python/schema.py:424–435  ·  view source on GitHub ↗
(self, nested_name, field)

Source from the content-addressed store, hash-verified

422 self._frozen = True
423
424 def _struct_from_nested_name(self, nested_name, field):
425 def create_internal(nested_name, field):
426 names = nested_name.split(FIELD_SEPARATOR, 1)
427 if len(names) == 1:
428 added_field = field
429 else:
430 added_field = create_internal(names[1], field)
431 return Struct((names[0], added_field))
432
433 names = nested_name.split(FIELD_SEPARATOR, 1)
434 assert len(names) >= 2
435 return names[0], create_internal(names[1], field)
436
437 def get_children(self):
438 return list(self.fields.items())

Callers 1

__init__Method · 0.95

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected