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)
| 1593 | |
| 1594 | |
| 1595 | def 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 | |
| 1634 | c_random_function_list = ( |