MCPcopy Create free account
hub / github.com/BVLC/caffe / CheckCaffeDataLayerSetUp

Function CheckCaffeDataLayerSetUp

scripts/cpp_lint.py:1599–1635  ·  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

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

Callers 1

ProcessLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected