MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / CheckCaffeDataLayerSetUp

Function CheckCaffeDataLayerSetUp

rtpose_wrapper/scripts/cpp_lint.py:1595–1631  ·  view source on GitHub ↗

Except the base classes, Caffe DataLayer should define DataLayerSetUp instead of LayerSetUp. The base DataLayers define common SetUp steps, the subclasses should not override them. Args: filename: The name of the current file. clean_lines: A CleansedLines instance contain

(filename, clean_lines, linenum, error)

Source from the content-addressed store, hash-verified

1593
1594
1595def CheckCaffeDataLayerSetUp(filename, clean_lines, linenum, error):
1596 """Except the base classes, Caffe DataLayer should define DataLayerSetUp
1597 instead of LayerSetUp.
1598
1599 The base DataLayers define common SetUp steps, the subclasses should
1600 not override them.
1601
1602 Args:
1603 filename: The name of the current file.
1604 clean_lines: A CleansedLines instance containing the file.
1605 linenum: The number of the line to check.
1606 error: The function to call with any errors found.
1607 """
1608 line = clean_lines.elided[linenum]
1609 ix = line.find('DataLayer<Dtype>::LayerSetUp')
1610 if ix >= 0 and (
1611 line.find('void DataLayer<Dtype>::LayerSetUp') != -1 or
1612 line.find('void ImageDataLayer<Dtype>::LayerSetUp') != -1 or
1613 line.find('void MemoryDataLayer<Dtype>::LayerSetUp') != -1 or
1614 line.find('void WindowDataLayer<Dtype>::LayerSetUp') != -1):
1615 error(filename, linenum, 'caffe/data_layer_setup', 2,
1616 'Except the base classes, Caffe DataLayer should define'
1617 + ' DataLayerSetUp instead of LayerSetUp. The base DataLayers'
1618 + ' define common SetUp steps, the subclasses should'
1619 + ' not override them.')
1620 ix = line.find('DataLayer<Dtype>::DataLayerSetUp')
1621 if ix >= 0 and (
1622 line.find('void Base') == -1 and
1623 line.find('void DataLayer<Dtype>::DataLayerSetUp') == -1 and
1624 line.find('void ImageDataLayer<Dtype>::DataLayerSetUp') == -1 and
1625 line.find('void MemoryDataLayer<Dtype>::DataLayerSetUp') == -1 and
1626 line.find('void WindowDataLayer<Dtype>::DataLayerSetUp') == -1):
1627 error(filename, linenum, 'caffe/data_layer_setup', 2,
1628 'Except the base classes, Caffe DataLayer should define'
1629 + ' DataLayerSetUp instead of LayerSetUp. The base DataLayers'
1630 + ' define common SetUp steps, the subclasses should'
1631 + ' not override them.')
1632
1633
1634c_random_function_list = (

Callers 1

ProcessLineFunction · 0.85

Calls 1

errorFunction · 0.85

Tested by

no test coverage detected