How to use modify_label method in autotest

Best Python code snippet using autotest_python

pytorch_build_data.py

Source:pytorch_build_data.py Github

copy

Full Screen

...103 parts = dotted_version.split(".")104 return "py" + parts[0]105class TreeConfigNode(ConfigNode):106 def __init__(self, parent, node_name, subtree):107 super(TreeConfigNode, self).__init__(parent, self.modify_label(node_name))108 self.subtree = subtree109 self.init2(node_name)110 def modify_label(self, label):111 return label112 def init2(self, node_name):113 pass114 def get_children(self):115 return [self.child_constructor()(self, k, v) for (k, v) in self.subtree]116class TopLevelNode(TreeConfigNode):117 def __init__(self, node_name, subtree):118 super(TopLevelNode, self).__init__(None, node_name, subtree)119 # noinspection PyMethodMayBeStatic120 def child_constructor(self):121 return DistroConfigNode122class DistroConfigNode(TreeConfigNode):123 def init2(self, node_name):124 self.props["distro_name"] = node_name125 def child_constructor(self):126 distro = self.find_prop("distro_name")127 next_nodes = {128 "xenial": XenialCompilerConfigNode,129 "bionic": BionicCompilerConfigNode,130 }131 return next_nodes[distro]132class PyVerConfigNode(TreeConfigNode):133 def init2(self, node_name):134 self.props["pyver"] = node_name135 self.props["abbreviated_pyver"] = get_major_pyver(node_name)136 # noinspection PyMethodMayBeStatic137 def child_constructor(self):138 return ExperimentalFeatureConfigNode139class ExperimentalFeatureConfigNode(TreeConfigNode):140 def init2(self, node_name):141 self.props["experimental_feature"] = node_name142 def child_constructor(self):143 experimental_feature = self.find_prop("experimental_feature")144 next_nodes = {145 "asan": AsanConfigNode,146 "xla": XlaConfigNode,147 "vulkan": VulkanConfigNode,148 "parallel_tbb": ParallelTBBConfigNode,149 "parallel_native": ParallelNativeConfigNode,150 "onnx": ONNXConfigNode,151 "libtorch": LibTorchConfigNode,152 "important": ImportantConfigNode,153 "build_only": BuildOnlyConfigNode,154 "shard_test": ShardTestConfigNode,155 "cuda_gcc_override": CudaGccOverrideConfigNode,156 "coverage": CoverageConfigNode,157 "pure_torch": PureTorchConfigNode,158 }159 return next_nodes[experimental_feature]160class PureTorchConfigNode(TreeConfigNode):161 def modify_label(self, label):162 return "PURE_TORCH=" + str(label)163 def init2(self, node_name):164 self.props["is_pure_torch"] = node_name165 def child_constructor(self):166 return ImportantConfigNode167class XlaConfigNode(TreeConfigNode):168 def modify_label(self, label):169 return "XLA=" + str(label)170 def init2(self, node_name):171 self.props["is_xla"] = node_name172 def child_constructor(self):173 return ImportantConfigNode174class AsanConfigNode(TreeConfigNode):175 def modify_label(self, label):176 return "Asan=" + str(label)177 def init2(self, node_name):178 self.props["is_asan"] = node_name179 def child_constructor(self):180 return ExperimentalFeatureConfigNode181class ONNXConfigNode(TreeConfigNode):182 def modify_label(self, label):183 return "Onnx=" + str(label)184 def init2(self, node_name):185 self.props["is_onnx"] = node_name186 def child_constructor(self):187 return ImportantConfigNode188class VulkanConfigNode(TreeConfigNode):189 def modify_label(self, label):190 return "Vulkan=" + str(label)191 def init2(self, node_name):192 self.props["is_vulkan"] = node_name193 def child_constructor(self):194 return ImportantConfigNode195class ParallelTBBConfigNode(TreeConfigNode):196 def modify_label(self, label):197 return "PARALLELTBB=" + str(label)198 def init2(self, node_name):199 self.props["parallel_backend"] = "paralleltbb"200 def child_constructor(self):201 return ImportantConfigNode202class ParallelNativeConfigNode(TreeConfigNode):203 def modify_label(self, label):204 return "PARALLELNATIVE=" + str(label)205 def init2(self, node_name):206 self.props["parallel_backend"] = "parallelnative"207 def child_constructor(self):208 return ImportantConfigNode209class LibTorchConfigNode(TreeConfigNode):210 def modify_label(self, label):211 return "BUILD_TEST_LIBTORCH=" + str(label)212 def init2(self, node_name):213 self.props["is_libtorch"] = node_name214 def child_constructor(self):215 return ExperimentalFeatureConfigNode216class CudaGccOverrideConfigNode(TreeConfigNode):217 def init2(self, node_name):218 self.props["cuda_gcc_override"] = node_name219 def child_constructor(self):220 return ExperimentalFeatureConfigNode221class BuildOnlyConfigNode(TreeConfigNode):222 def init2(self, node_name):223 self.props["build_only"] = node_name224 def child_constructor(self):225 return ExperimentalFeatureConfigNode226class ShardTestConfigNode(TreeConfigNode):227 def init2(self, node_name):228 self.props["shard_test"] = node_name229 def child_constructor(self):230 return ImportantConfigNode231class CoverageConfigNode(TreeConfigNode):232 def init2(self, node_name):233 self.props["is_coverage"] = node_name234 def child_constructor(self):235 return ExperimentalFeatureConfigNode236class ImportantConfigNode(TreeConfigNode):237 def modify_label(self, label):238 return "IMPORTANT=" + str(label)239 def init2(self, node_name):240 self.props["is_important"] = node_name241 def get_children(self):242 return []243class XenialCompilerConfigNode(TreeConfigNode):244 def modify_label(self, label):245 return label or "<unspecified>"246 def init2(self, node_name):247 self.props["compiler_name"] = node_name248 # noinspection PyMethodMayBeStatic249 def child_constructor(self):250 return XenialCompilerVersionConfigNode if self.props["compiler_name"] else PyVerConfigNode251class BionicCompilerConfigNode(TreeConfigNode):252 def modify_label(self, label):253 return label or "<unspecified>"254 def init2(self, node_name):255 self.props["compiler_name"] = node_name256 # noinspection PyMethodMayBeStatic257 def child_constructor(self):258 return BionicCompilerVersionConfigNode if self.props["compiler_name"] else PyVerConfigNode259class XenialCompilerVersionConfigNode(TreeConfigNode):260 def init2(self, node_name):261 self.props["compiler_version"] = node_name262 # noinspection PyMethodMayBeStatic263 def child_constructor(self):264 return PyVerConfigNode265class BionicCompilerVersionConfigNode(TreeConfigNode):266 def init2(self, node_name):...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful