Returns a list of learning rates blob names used in the optimizer.
(model)
| 985 | |
| 986 | |
| 987 | def GetLearningRateBlobNames(model): |
| 988 | ''' |
| 989 | Returns a list of learning rates blob names used in the optimizer. |
| 990 | ''' |
| 991 | if model._optimizer is not None: |
| 992 | if model._device_type == caffe2_pb2.CPU or model._device_type == caffe2_pb2.IDEEP: |
| 993 | return [model._optimizer.get_cpu_blob_name('lr')] |
| 994 | elif core.IsGPUDeviceType(model._device_type): |
| 995 | return [model._optimizer.get_gpu_blob_name('lr', gpu, '') |
| 996 | for gpu in model._devices] |
| 997 | else: |
| 998 | raise Exception( |
| 999 | "Unsupported device type : {}".format(model._device_type) |
| 1000 | ) |
| 1001 | else: |
| 1002 | lr_blob_names = [] |
| 1003 | for op in model.net.Proto().op: |
| 1004 | if op.type == "LearningRate": |
| 1005 | lr_blob_names.append(op.output(0)) |
| 1006 | return lr_blob_names |
| 1007 | |
| 1008 | |
| 1009 | def _Broadcast(devices, model, net, param, use_nccl=False): |
nothing calls this directly
no test coverage detected
searching dependent graphs…