torch/torch7 — pull request #60 by timharley (2014-08-01 12:13:53+00:00)
Title: Make :data() on an empty Tensor return nil rather than segfault.

Fixes this:

$ torch -e "torch.Tensor():data()"
Torch 7.0 Copyright (C) 2001-2011 Idiap, NEC Labs, NYU
Segmentation fault: 11

To get this instead:

$ torch -e "print(torch.Tensor():data())"
Torch 7.0 Copyright (C) 2001-2011 Idiap, NEC Labs, NYU
nil

Also means this doesn't segfault: `torch.Tensor():apply(function() end)`