ddp causes an error when my model class has a lambda function
🐛 Bug

To Reproduce
Steps to reproduce the behavior:

Add self.fn_error = lambda x: x to the model (e.g., your_model).
Run the trainer with ddp backend.
It causes an error like 'AttributeError: Can't pickle local object 'your_model.init..'.


Code sample

Expected behavior
When I use dp backend, everything is ok.

Environment
cuda:
	GPU:
		TITAN RTX
		TITAN RTX
	available:           True
	version:             10.2
packages:
	numpy:               1.17.2
	pyTorch_debug:       False
	pyTorch_version:     1.6.0a0+b55dee9
	pytorch-lightning:   0.7.4-dev
	tensorboard:         2.2.0
	tqdm:                4.45.0
system:
	OS:                  Linux
	architecture:
		64bit
		
	processor:           x86_64
	python:              3.7.4
	version:             #86~16.04.1-Ubuntu SMP Mon Jan 20 11:02:50 UTC 2020

Additional context